1 package de.juplo.kafka.chat.backend.persistence.storage.mongodb;
3 import de.juplo.kafka.chat.backend.persistence.inmemory.ShardingStrategy;
4 import de.juplo.kafka.chat.backend.persistence.StorageStrategy;
5 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
6 import org.springframework.context.annotation.Bean;
7 import org.springframework.context.annotation.Configuration;
10 @ConditionalOnProperty(
11 prefix = "chat.backend.inmemory",
12 name = "storage-strategy",
13 havingValue = "mongodb")
15 public class MongoDbStorageConfiguration
18 public StorageStrategy storageStrategy(
19 ChatRoomRepository chatRoomRepository,
20 MessageRepository messageRepository,
21 ShardingStrategy shardingStrategy)
23 return new MongoDbStorageStrategy(