1 package de.juplo.kafka.chat.backend.persistence.inmemory;
3 import de.juplo.kafka.chat.backend.ChatBackendProperties;
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;
9 import java.time.Clock;
12 @ConditionalOnProperty(
13 prefix = "chat.backend",
15 havingValue = "in-memory",
16 matchIfMissing = true)
18 public class InMemoryServicesAutoConfiguration
21 InMemoryChatHomeService chatHomeService(
22 StorageStrategy storageStrategy,
24 ChatBackendProperties properties)
26 return new InMemoryChatHomeService(
27 storageStrategy.read(),
29 properties.getChatroomBufferSize());