X-Git-Url: http://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fchat%2Fbackend%2FChatBackendProperties.java;h=df4d1cd741d1e7d80fe910c817f45d6abc99187b;hb=2800b80bb0a02feb70ab9d0c804b2fcc9915f479;hp=5cd4535cbd4ebf98c6874fd4aa797cf85607c33a;hpb=ff98b068a91fc9e60e51bd4a95065633bb8ed2db;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 5cd4535c..df4d1cd7 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java +++ b/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java @@ -4,7 +4,9 @@ import lombok.Getter; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; +import java.net.URI; import java.nio.file.Paths; +import java.util.logging.Level; @ConfigurationProperties("chat.backend") @@ -12,24 +14,49 @@ import java.nio.file.Paths; @Setter public class ChatBackendProperties { + private String instanceId = "DEV"; 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(); + private ProjectreactorProperties projectreactor = new ProjectreactorProperties(); @Getter @Setter public static class InMemoryServicesProperties { - private ShardingStrategyType shardingStrategy = ShardingStrategyType.kafkalike; - private int numShards = 10; - private int[] ownedShards = { 2 }; - private StorageStrategyType storageStrategy = StorageStrategyType.files; + private ShardingStrategyType shardingStrategy = ShardingStrategyType.none; + private int numShards = 1; + 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 } - public enum StorageStrategyType { files, mongodb } + @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; + private String haproxyRuntimeApi = "haproxy:8401"; + private String haproxyMap = "/usr/local/etc/haproxy/sharding.map"; + } + + @Getter + @Setter + public static class ProjectreactorProperties + { + private Level loggingLevel = Level.FINE; + private boolean showOperatorLine = true; + } + public enum ServiceType { inmemory, kafka } + public enum StorageStrategyType { none, files, mongodb } public enum ShardingStrategyType { none, kafkalike } }