X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fchat%2Fbackend%2FChatBackendProperties.java;h=ec5c7f5f8753031aa3be6285e0dad9bc89871260;hb=8d997cc65763b3f12fb680da67f471590e6eeeb2;hp=def9de175c98cb866af31f91efb6c4be8c1ebe9b;hpb=cd192a26afb8beb0e45cb0807e7f63e30e87966a;p=demos%2Fkafka%2Fchat diff --git a/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java b/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java index def9de17..ec5c7f5f 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java +++ b/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java @@ -4,6 +4,7 @@ import lombok.Getter; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; +import java.net.URI; import java.nio.file.Paths; @@ -16,6 +17,7 @@ public class ChatBackendProperties private int chatroomBufferSize = 8; private ServiceType services = ServiceType.inmemory; private InMemoryServicesProperties inmemory = new InMemoryServicesProperties(); + private KafkaServicesProperties kafka = new KafkaServicesProperties(); @Getter @@ -24,12 +26,25 @@ public class ChatBackendProperties { private ShardingStrategyType shardingStrategy = ShardingStrategyType.none; private int numShards = 1; - private int[] ownedShards = new int[] { 0 }; + private int[] ownedShards = new int[0]; + private URI[] shardOwners = new URI[0]; private StorageStrategyType storageStrategy = StorageStrategyType.none; private String storageDirectory = Paths.get(System.getProperty("java.io.tmpdir"),"chat", "backend").toString(); } - public enum ServiceType { inmemory } + @Getter + @Setter + public static class KafkaServicesProperties + { + private URI instanceUri = URI.create("http://localhost:8080"); + private String clientIdPrefix = "DEV"; + private String bootstrapServers = ":9092"; + private String infoChannelTopic = "info_channel"; + private String dataChannelTopic = "data_channel"; + private int numPartitions = 2; + } + + public enum ServiceType { inmemory, kafka } public enum StorageStrategyType { none, files, mongodb } public enum ShardingStrategyType { none, kafkalike } }