X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fchat%2Fbackend%2FChatBackendProperties.java;h=9c80f5d65379422733efa456f0d29e0d25a9a59e;hb=2ccf8e29b0ffb2366a717392fa996707fde1821d;hp=598e8ce0d047985df6a1d031bba5af4ca903752b;hpb=9e3e6397414722ad6f9a43381b4501edf4f56134;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 598e8ce0..9c80f5d6 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java +++ b/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java @@ -12,5 +12,35 @@ import java.nio.file.Paths; @Setter public class ChatBackendProperties { - private String datadir = Paths.get(System.getProperty("java.io.tmpdir"),"chat", "backend").toString(); + private String allowedOrigins = "http://localhost:4200"; + private int chatroomBufferSize = 8; + private ServiceType services = ServiceType.inmemory; + private InMemoryServicesProperties inmemory = new InMemoryServicesProperties(); + private KafkaServicesProperties kafka = new KafkaServicesProperties(); + + + @Getter + @Setter + public static class InMemoryServicesProperties + { + private ShardingStrategyType shardingStrategy = ShardingStrategyType.none; + private int numShards = 1; + private int[] ownedShards = new int[] { 0 }; + private StorageStrategyType storageStrategy = StorageStrategyType.none; + private String storageDirectory = Paths.get(System.getProperty("java.io.tmpdir"),"chat", "backend").toString(); + } + + @Getter + @Setter + public static class KafkaServicesProperties + { + private String clientIdPrefix; + private String bootstrapServers = ":9092"; + private String chatRoomChannelTopic = "message_channel"; + private int numPartitions = 2; + } + + public enum ServiceType { inmemory, kafka } + public enum StorageStrategyType { none, files, mongodb } + public enum ShardingStrategyType { none, kafkalike } }