From f72808fd5d9569a1718da65fa9e504536d3e85c3 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 12 Jan 2023 22:58:56 +0100 Subject: [PATCH] fix: Supressed mongo-autoconfiguration if `FilesStorageStrategy` is active --- .../storage/files/FilesStorageConfiguration.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.20.1