TMP
[demos/kafka/chat] / src / main / java / de / juplo / kafka / chat / backend / storage / nostorage / NoStorageStorageConfiguration.java
1 package de.juplo.kafka.chat.backend.storage.nostorage;
2
3 import de.juplo.kafka.chat.backend.implementation.StorageStrategy;
4 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
5 import org.springframework.context.annotation.Bean;
6 import org.springframework.context.annotation.Configuration;
7 import org.springframework.context.annotation.Lazy;
8
9
10 @ConditionalOnProperty(
11     prefix = "chat.backend.inmemory",
12     name = "storage-strategy",
13     havingValue = "none",
14     matchIfMissing = true)
15 @Configuration
16 public class NoStorageStorageConfiguration
17 {
18   @Bean
19   public StorageStrategy storageStrategy()
20   {
21     return new NoStorageStorageStrategy();
22   }
23
24   @Bean
25   @Lazy(false)
26   public String foo()
27   {
28     return "FOO";
29   }
30 }