From: Kai Moritz Date: Thu, 12 Jan 2023 21:58:56 +0000 (+0100) Subject: fix: Supressed mongo-autoconfiguration if `FilesStorageStrategy` is active X-Git-Tag: wip-sharding~35 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=f72808fd5d9569a1718da65fa9e504536d3e85c3;p=demos%2Fkafka%2Fchat fix: Supressed mongo-autoconfiguration if `FilesStorageStrategy` is active --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageConfiguration.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageConfiguration.java index ae6af2f5..31e285ca 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageConfiguration.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageConfiguration.java @@ -4,7 +4,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import de.juplo.kafka.chat.backend.ChatBackendProperties; import de.juplo.kafka.chat.backend.persistence.StorageStrategy; import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatRoomService; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration; +import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -18,6 +21,10 @@ import java.time.Clock; havingValue = "files", matchIfMissing = true) @Configuration +@EnableAutoConfiguration( + exclude = { + MongoRepositoriesAutoConfiguration.class, + MongoAutoConfiguration.class }) public class FilesStorageConfiguration { @Bean