--- /dev/null
+package de.juplo.kafka.chat.backend.storage.mongodb;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
+
+
+@ConditionalOnExpression("#{${chat.backend.inmemory.storage-strategy} != 'mongodb'}")
+@Configuration
+@Slf4j
+public class MongoDbStorageNotActiveConfiguration
+{
+ @Bean
+ @Lazy(false)
+ public String foo()
+ {
+ log.info("FOO!");
+ return "FOO";
+ }
+}
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Lazy;
@ConditionalOnProperty(
{
return new NoStorageStorageStrategy();
}
-
- @Bean
- @Lazy(false)
- public String foo()
- {
- log.info("FOO (woanders)!");
- return "FOO";
- }
}
+++ /dev/null
-package de.juplo.kafka.chat.backend;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Lazy;
-
-
-@Configuration
-@Slf4j
-public class MongoDbStorageNotActiveConfiguration
-{
- @Bean
- @Lazy(false)
- public String foo()
- {
- log.info("FOO!");
- return "FOO";
- }
-}