feat: Introduced config switches to choose the used implementations
[demos/kafka/chat] / src / main / java / de / juplo / kafka / chat / backend / ChatBackendConfiguration.java
1 package de.juplo.kafka.chat.backend;
2
3 import de.juplo.kafka.chat.backend.domain.ChatHome;
4 import de.juplo.kafka.chat.backend.domain.ChatHomeService;
5 import org.springframework.boot.context.properties.EnableConfigurationProperties;
6 import org.springframework.context.annotation.Bean;
7 import org.springframework.context.annotation.Configuration;
8
9 import java.time.Clock;
10
11
12 @Configuration
13 @EnableConfigurationProperties(ChatBackendProperties.class)
14 public class ChatBackendConfiguration
15 {
16   @Bean
17   public ChatHome chatHome(ChatHomeService chatHomeService)
18   {
19     return new ChatHome(chatHomeService);
20   }
21
22   @Bean
23   public Clock clock()
24   {
25     return Clock.systemDefaultZone();
26   }
27 }