From: Kai Moritz Date: Sat, 14 Jan 2023 16:40:21 +0000 (+0100) Subject: chore: Switched the default-configuration to sharding `none` X-Git-Tag: wip-sharding~24 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=5e027064643ea9060c3a2cc8f4272360fa02abd3;p=demos%2Fkafka%2Fchat chore: Switched the default-configuration to sharding `none` --- 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..177d4f51 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java +++ b/src/main/java/de/juplo/kafka/chat/backend/ChatBackendProperties.java @@ -22,9 +22,9 @@ public class ChatBackendProperties @Setter public static class InMemoryServicesProperties { - private ShardingStrategyType shardingStrategy = ShardingStrategyType.kafkalike; - private int numShards = 10; - private int[] ownedShards = { 2 }; + private ShardingStrategyType shardingStrategy = ShardingStrategyType.none; + private int numShards = 1; + private int[] ownedShards = new int[] { 0 }; private StorageStrategyType storageStrategy = StorageStrategyType.files; private String storageDirectory = Paths.get(System.getProperty("java.io.tmpdir"),"chat", "backend").toString(); } diff --git a/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesAndShardingConfigurationIT.java b/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesAndShardingConfigurationIT.java index 5138deed..d792d258 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesAndShardingConfigurationIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesAndShardingConfigurationIT.java @@ -7,7 +7,9 @@ import org.springframework.boot.test.context.SpringBootTest; webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "chat.backend.inmemory.storage-directory=target/test-classes/data/files", - "chat.backend.inmemory.sharding-strategy=kafkalike" }) + "chat.backend.inmemory.sharding-strategy=kafkalike", + "chat.backend.inmemory.num-shards=10", + "chat.backend.inmemory.owned-shards=2" }) class InMemoryWithFilesAndShardingConfigurationIT extends AbstractConfigurationIT { }