1 package de.juplo.kafka.chat.backend.storage.files;
3 import com.fasterxml.jackson.databind.ObjectMapper;
4 import de.juplo.kafka.chat.backend.ChatBackendProperties;
5 import de.juplo.kafka.chat.backend.implementation.ShardingStrategy;
6 import de.juplo.kafka.chat.backend.implementation.StorageStrategy;
7 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
8 import org.springframework.context.annotation.Bean;
9 import org.springframework.context.annotation.Configuration;
11 import java.nio.file.Paths;
14 @ConditionalOnProperty(
15 prefix = "chat.backend.inmemory",
16 name = "storage-strategy",
17 havingValue = "files")
19 public class FilesStorageConfiguration
22 public StorageStrategy storageStrategy(
23 ChatBackendProperties properties,
24 ShardingStrategy shardingStrategy,
27 return new FilesStorageStrategy(
28 Paths.get(properties.getInmemory().getStorageDirectory()),
31 properties.getProjectreactor().getLoggingLevel(),
32 properties.getProjectreactor().isShowOperatorLine());