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~37 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=a2a3c057bb11486848dbfeb453311d2b0b92b1fd;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