From: Kai Moritz Date: Sat, 14 Jan 2023 15:47:04 +0000 (+0100) Subject: refactor: Pulled business-logic into class `ShardedChatHome` X-Git-Tag: wip-sharding~26 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=b4b3b9dff26d99f11d21c54ff004a73247bbc84d;p=demos%2Fkafka%2Fchat refactor: Pulled business-logic into class `ShardedChatHome` - Pulled the logic that selects the appropriate shard from the class `ChatBackendController` into the newly introduced class `ShardedChatHome`. - Simplified the configuration - `InMemoryServicesConfiguration` creates a `ChatHome` of type `SimpleChatHome`, if the `sharding-strategy` `none` is choosen. - In that case, the values for `num-shards` and `owned-shards` are ignored and set to `1` and `0`. - If the `sharding-strategy` is set to `kafkalike`, a `ChatHome` of type `ShardedChatHome` is instanciated and the configuration respects the configured sharding. - Simplified the configuration of `ChatBackendControllerTest` accordingly. --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java b/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java index 9be7fa16..36bec48a 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java +++ b/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java @@ -17,8 +17,7 @@ import java.util.UUID; @RequiredArgsConstructor public class ChatBackendController { - private final ChatHome[] chatHomes; - private final ShardingStrategy selectionStrategy; + private final ChatHome chatHome; private final ChatRoomFactory factory; private final StorageStrategy storageStrategy; @@ -29,23 +28,22 @@ public class ChatBackendController UUID chatRoomId = UUID.randomUUID(); return factory .createChatRoom(chatRoomId, name) - .flatMap(chatRoom -> chatHomes[chatRoom.getShard()].putChatRoom(chatRoom)) + .flatMap(chatRoom -> chatHome.putChatRoom(chatRoom)) .map(ChatRoomTo::from); } @GetMapping("list") public Flux list() { - return Flux - .fromArray(chatHomes) - .flatMap(chatHome -> chatHome.getChatRooms()) + return chatHome + .getChatRooms() .map(chatroom -> ChatRoomTo.from(chatroom)); } @GetMapping("{chatroomId}/list") public Flux list(@PathVariable UUID chatroomId) { - return chatHomes[selectShard(chatroomId)] + return chatHome .getChatRoom(chatroomId) .flatMapMany(chatroom -> chatroom .getMessages() @@ -55,7 +53,7 @@ public class ChatBackendController @GetMapping("{chatroomId}") public Mono get(@PathVariable UUID chatroomId) { - return chatHomes[selectShard(chatroomId)] + return chatHome .getChatRoom(chatroomId) .map(chatroom -> ChatRoomTo.from(chatroom)); } @@ -68,7 +66,7 @@ public class ChatBackendController @RequestBody String text) { return - chatHomes[selectShard(chatroomId)] + chatHome .getChatRoom(chatroomId) .flatMap(chatroom -> put(chatroom, username, messageId, text)); } @@ -95,7 +93,7 @@ public class ChatBackendController @PathVariable Long messageId) { return - chatHomes[selectShard(chatroomId)] + chatHome .getChatRoom(chatroomId) .flatMap(chatroom -> get(chatroom, username, messageId)); } @@ -114,7 +112,7 @@ public class ChatBackendController @GetMapping(path = "{chatroomId}/listen") public Flux> listen(@PathVariable UUID chatroomId) { - return chatHomes[selectShard(chatroomId)] + return chatHome .getChatRoom(chatroomId) .flatMapMany(chatroom -> listen(chatroom)); } @@ -136,12 +134,6 @@ public class ChatBackendController @PostMapping("/store") public void store() { - for (int shard = 0; shard < chatHomes.length; shard++) - storageStrategy.write(chatHomes[shard].getChatRooms()); - } - - private int selectShard(UUID chatroomId) - { - return selectionStrategy.selectShard(chatroomId); + storageStrategy.write(chatHome.getChatRooms()); } } diff --git a/src/main/java/de/juplo/kafka/chat/backend/api/KafkaLikeShardingStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/api/KafkaLikeShardingStrategy.java deleted file mode 100644 index d06ee58a..00000000 --- a/src/main/java/de/juplo/kafka/chat/backend/api/KafkaLikeShardingStrategy.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.juplo.kafka.chat.backend.api; - -import lombok.RequiredArgsConstructor; -import org.apache.kafka.common.utils.Utils; - -import java.util.UUID; - - -@RequiredArgsConstructor -public class KafkaLikeShardingStrategy implements ShardingStrategy -{ - private final int numPartitions; - - @Override - public int selectShard(UUID chatRoomId) - { - byte[] serializedKey = chatRoomId.toString().getBytes(); - return Utils.toPositive(Utils.murmur2(serializedKey)) % numPartitions; - } -} diff --git a/src/main/java/de/juplo/kafka/chat/backend/api/ShardingStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/api/ShardingStrategy.java deleted file mode 100644 index 36f7e230..00000000 --- a/src/main/java/de/juplo/kafka/chat/backend/api/ShardingStrategy.java +++ /dev/null @@ -1,9 +0,0 @@ -package de.juplo.kafka.chat.backend.api; - -import java.util.UUID; - - -public interface ShardingStrategy -{ - int selectShard(UUID chatRoomId); -} diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ShardedChatHome.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ShardedChatHome.java new file mode 100644 index 00000000..ffa7860a --- /dev/null +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ShardedChatHome.java @@ -0,0 +1,42 @@ +package de.juplo.kafka.chat.backend.domain; + +import lombok.RequiredArgsConstructor; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.util.UUID; + + +@RequiredArgsConstructor +public class ShardedChatHome implements ChatHome +{ + private final ChatHome[] chatHomes; + private final ShardingStrategy selectionStrategy; + + + @Override + public Mono putChatRoom(ChatRoom chatRoom) + { + return chatHomes[selectShard(chatRoom.getId())].putChatRoom(chatRoom); + } + + @Override + public Mono getChatRoom(UUID id) + { + return chatHomes[selectShard(id)].getChatRoom(id); + } + + @Override + public Flux getChatRooms() + { + return Flux + .fromArray(chatHomes) + .flatMap(chatHome -> chatHome.getChatRooms()); + } + + + private int selectShard(UUID chatroomId) + { + return selectionStrategy.selectShard(chatroomId); + } +} diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ShardingStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ShardingStrategy.java new file mode 100644 index 00000000..dde0e543 --- /dev/null +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ShardingStrategy.java @@ -0,0 +1,9 @@ +package de.juplo.kafka.chat.backend.domain; + +import java.util.UUID; + + +public interface ShardingStrategy +{ + int selectShard(UUID chatRoomId); +} diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/SimpleChatHome.java b/src/main/java/de/juplo/kafka/chat/backend/domain/SimpleChatHome.java index daa710bf..b15eab3b 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/SimpleChatHome.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/SimpleChatHome.java @@ -15,6 +15,13 @@ public class SimpleChatHome implements ChatHome private final ChatHomeService service; private final int shard; + + public SimpleChatHome(ChatHomeService service) + { + this(service, 0); + } + + @Override public Mono putChatRoom(ChatRoom chatRoom) { diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/KafkaLikeShardingStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/KafkaLikeShardingStrategy.java new file mode 100644 index 00000000..41fd9cd0 --- /dev/null +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/KafkaLikeShardingStrategy.java @@ -0,0 +1,21 @@ +package de.juplo.kafka.chat.backend.persistence; + +import de.juplo.kafka.chat.backend.domain.ShardingStrategy; +import lombok.RequiredArgsConstructor; +import org.apache.kafka.common.utils.Utils; + +import java.util.UUID; + + +@RequiredArgsConstructor +public class KafkaLikeShardingStrategy implements ShardingStrategy +{ + private final int numPartitions; + + @Override + public int selectShard(UUID chatRoomId) + { + byte[] serializedKey = chatRoomId.toString().getBytes(); + return Utils.toPositive(Utils.murmur2(serializedKey)) % numPartitions; + } +} diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatRoomFactory.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatRoomFactory.java index 50fa7057..7fff359c 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatRoomFactory.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatRoomFactory.java @@ -1,6 +1,6 @@ package de.juplo.kafka.chat.backend.persistence.inmemory; -import de.juplo.kafka.chat.backend.api.ShardingStrategy; +import de.juplo.kafka.chat.backend.domain.ShardingStrategy; import de.juplo.kafka.chat.backend.domain.ChatRoom; import de.juplo.kafka.chat.backend.domain.ChatRoomFactory; import de.juplo.kafka.chat.backend.domain.ChatRoomService; diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryServicesConfiguration.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryServicesConfiguration.java index a0f37f06..96ef05c2 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryServicesConfiguration.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryServicesConfiguration.java @@ -1,8 +1,10 @@ package de.juplo.kafka.chat.backend.persistence.inmemory; import de.juplo.kafka.chat.backend.ChatBackendProperties; -import de.juplo.kafka.chat.backend.api.KafkaLikeShardingStrategy; -import de.juplo.kafka.chat.backend.api.ShardingStrategy; +import de.juplo.kafka.chat.backend.ChatBackendProperties.ShardingStrategyType; +import de.juplo.kafka.chat.backend.domain.ShardedChatHome; +import de.juplo.kafka.chat.backend.persistence.KafkaLikeShardingStrategy; +import de.juplo.kafka.chat.backend.domain.ShardingStrategy; import de.juplo.kafka.chat.backend.domain.ChatHome; import de.juplo.kafka.chat.backend.domain.SimpleChatHome; import de.juplo.kafka.chat.backend.persistence.StorageStrategy; @@ -22,12 +24,28 @@ import java.time.Clock; public class InMemoryServicesConfiguration { @Bean - ChatHome[] chatHomes( + @ConditionalOnProperty( + prefix = "chat.backend.inmemory", + name = "sharding-strategy", + havingValue = "none", + matchIfMissing = true) + ChatHome noneShardingChatHome(InMemoryChatHomeService chatHomeService) + { + return new SimpleChatHome(chatHomeService); + } + + @Bean + @ConditionalOnProperty( + prefix = "chat.backend.inmemory", + name = "sharding-strategy", + havingValue = "kafkalike") + ChatHome kafkalikeShardingChatHome( ChatBackendProperties properties, InMemoryChatHomeService chatHomeService, StorageStrategy storageStrategy) { - SimpleChatHome[] chatHomes = new SimpleChatHome[properties.getInmemory().getNumShards()]; + int numShards = properties.getInmemory().getNumShards(); + SimpleChatHome[] chatHomes = new SimpleChatHome[numShards]; storageStrategy .read() .subscribe(chatRoom -> @@ -36,7 +54,8 @@ public class InMemoryServicesConfiguration if (chatHomes[shard] == null) chatHomes[shard] = new SimpleChatHome(chatHomeService, shard); }); - return chatHomes; + ShardingStrategy strategy = new KafkaLikeShardingStrategy(numShards); + return new ShardedChatHome(chatHomes, strategy); } @Bean @@ -44,9 +63,17 @@ public class InMemoryServicesConfiguration ChatBackendProperties properties, StorageStrategy storageStrategy) { + ShardingStrategyType sharding = + properties.getInmemory().getShardingStrategy(); + int numShards = sharding == ShardingStrategyType.none + ? 1 + : properties.getInmemory().getNumShards(); + int[] ownedShards = sharding == ShardingStrategyType.none + ? new int[] { 0 } + : properties.getInmemory().getOwnedShards(); return new InMemoryChatHomeService( - properties.getInmemory().getNumShards(), - properties.getInmemory().getOwnedShards(), + numShards, + ownedShards, storageStrategy.read()); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageConfiguration.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageConfiguration.java index c7e56436..df730aaf 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageConfiguration.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageConfiguration.java @@ -2,7 +2,7 @@ package de.juplo.kafka.chat.backend.persistence.storage.files; import com.fasterxml.jackson.databind.ObjectMapper; import de.juplo.kafka.chat.backend.ChatBackendProperties; -import de.juplo.kafka.chat.backend.api.ShardingStrategy; +import de.juplo.kafka.chat.backend.domain.ShardingStrategy; import de.juplo.kafka.chat.backend.persistence.StorageStrategy; import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatRoomService; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageStrategy.java index 24c6a01e..1e3e5eef 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageStrategy.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageStrategy.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; import de.juplo.kafka.chat.backend.api.ChatRoomTo; import de.juplo.kafka.chat.backend.api.MessageTo; -import de.juplo.kafka.chat.backend.api.ShardingStrategy; +import de.juplo.kafka.chat.backend.domain.ShardingStrategy; import de.juplo.kafka.chat.backend.domain.ChatRoom; import de.juplo.kafka.chat.backend.domain.Message; import de.juplo.kafka.chat.backend.persistence.StorageStrategy; diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageConfiguration.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageConfiguration.java index 862dac07..2b33eed7 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageConfiguration.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageConfiguration.java @@ -1,7 +1,7 @@ package de.juplo.kafka.chat.backend.persistence.storage.mongodb; import de.juplo.kafka.chat.backend.ChatBackendProperties; -import de.juplo.kafka.chat.backend.api.ShardingStrategy; +import de.juplo.kafka.chat.backend.domain.ShardingStrategy; import de.juplo.kafka.chat.backend.persistence.StorageStrategy; import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatRoomService; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageStrategy.java index ec90e945..d21fe2ba 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageStrategy.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageStrategy.java @@ -1,6 +1,6 @@ package de.juplo.kafka.chat.backend.persistence.storage.mongodb; -import de.juplo.kafka.chat.backend.api.ShardingStrategy; +import de.juplo.kafka.chat.backend.domain.ShardingStrategy; import de.juplo.kafka.chat.backend.domain.ChatRoom; import de.juplo.kafka.chat.backend.persistence.StorageStrategy; import de.juplo.kafka.chat.backend.persistence.storage.files.ChatRoomServiceFactory; diff --git a/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesConfigurationIT.java b/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesConfigurationIT.java index 9027c6f4..151a833a 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesConfigurationIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/InMemoryWithFilesConfigurationIT.java @@ -7,8 +7,6 @@ import org.springframework.boot.test.context.SpringBootTest; webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "chat.backend.inmemory.sharding-strategy=none", - "chat.backend.inmemory.num-shards=1", - "chat.backend.inmemory.owned-shards=0", "chat.backend.inmemory.storage-directory=target/test-classes/data/files" }) class InMemoryWithFilesConfigurationIT extends AbstractConfigurationIT { diff --git a/src/test/java/de/juplo/kafka/chat/backend/api/ChatBackendControllerTest.java b/src/test/java/de/juplo/kafka/chat/backend/api/ChatBackendControllerTest.java index b1c80a90..1b25a11e 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/api/ChatBackendControllerTest.java +++ b/src/test/java/de/juplo/kafka/chat/backend/api/ChatBackendControllerTest.java @@ -1,6 +1,5 @@ package de.juplo.kafka.chat.backend.api; -import de.juplo.kafka.chat.backend.ChatBackendProperties; import de.juplo.kafka.chat.backend.domain.*; import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatHomeService; import lombok.extern.slf4j.Slf4j; @@ -9,16 +8,13 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.TestConfiguration; import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Bean; import org.springframework.http.MediaType; import org.springframework.test.web.reactive.server.WebTestClient; import reactor.core.publisher.Mono; import java.time.Clock; import java.time.LocalDateTime; -import java.util.Arrays; import java.util.UUID; import static org.mockito.ArgumentMatchers.any; @@ -27,7 +23,7 @@ import static org.mockito.Mockito.*; @SpringBootTest(properties = { "spring.main.allow-bean-definition-overriding=true", - "chat.backend.inmemory.owned-shards=0,1,2,3,4,5,6,7,8,9" }) + "chat.backend.inmemory.sharding-strategy=none" }) @AutoConfigureWebTestClient @Slf4j public class ChatBackendControllerTest @@ -255,20 +251,4 @@ public class ChatBackendControllerTest .jsonPath("$.username").isEqualTo(user); verify(chatRoomService, never()).persistMessage(eq(key), any(LocalDateTime.class), any(String.class)); } - - @TestConfiguration - static class Config - { - @Bean - ChatHome[] chatHomes( - ChatBackendProperties properties, - InMemoryChatHomeService service) - { - SimpleChatHome[] chatHomes = new SimpleChatHome[properties.getInmemory().getNumShards()]; - Arrays - .stream(properties.getInmemory().getOwnedShards()) - .forEach(i -> chatHomes[i] = new SimpleChatHome(service, i)); - return chatHomes; - } - } } diff --git a/src/test/java/de/juplo/kafka/chat/backend/domain/SimpleChatHomeTest.java b/src/test/java/de/juplo/kafka/chat/backend/domain/SimpleChatHomeTest.java index a648daee..5b53607f 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/domain/SimpleChatHomeTest.java +++ b/src/test/java/de/juplo/kafka/chat/backend/domain/SimpleChatHomeTest.java @@ -30,7 +30,7 @@ public class SimpleChatHomeTest mock(ChatRoomService.class), 8); when(chatHomeService.getChatRoom(anyInt(), any(UUID.class))).thenReturn(Mono.just(chatRoom)); - SimpleChatHome chatHome = new SimpleChatHome(chatHomeService, 0); + SimpleChatHome chatHome = new SimpleChatHome(chatHomeService); // When Mono mono = chatHome.getChatRoom(chatRoom.getId()); @@ -46,7 +46,7 @@ public class SimpleChatHomeTest // Given ChatHomeService chatHomeService = mock(ChatHomeService.class); when(chatHomeService.getChatRoom(anyInt(), any(UUID.class))).thenReturn(Mono.empty()); - SimpleChatHome chatHome = new SimpleChatHome(chatHomeService, 0); + SimpleChatHome chatHome = new SimpleChatHome(chatHomeService); // When Mono mono = chatHome.getChatRoom(UUID.randomUUID()); diff --git a/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractStorageStrategyIT.java b/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractStorageStrategyIT.java index 58cfaf0e..c934ff40 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractStorageStrategyIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractStorageStrategyIT.java @@ -24,7 +24,7 @@ public abstract class AbstractStorageStrategyIT protected void start() { - chathome = new SimpleChatHome(getChatHomeServiceSupplier().get(), 0); + chathome = new SimpleChatHome(getChatHomeServiceSupplier().get()); chatRoomFactory = getChatRoomFactory(); } diff --git a/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithFilesStorageIT.java b/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithFilesStorageIT.java index 8972b04e..fe7ecac1 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithFilesStorageIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithFilesStorageIT.java @@ -3,7 +3,7 @@ package de.juplo.kafka.chat.backend.persistence; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import de.juplo.kafka.chat.backend.api.ShardingStrategy; +import de.juplo.kafka.chat.backend.domain.ShardingStrategy; import de.juplo.kafka.chat.backend.domain.ChatHomeService; import de.juplo.kafka.chat.backend.domain.ChatRoomFactory; import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatRoomFactory; diff --git a/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithMongoDbStorageIT.java b/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithMongoDbStorageIT.java index 34e21268..9808aa31 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithMongoDbStorageIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/persistence/InMemoryWithMongoDbStorageIT.java @@ -1,6 +1,6 @@ package de.juplo.kafka.chat.backend.persistence; -import de.juplo.kafka.chat.backend.api.ShardingStrategy; +import de.juplo.kafka.chat.backend.domain.ShardingStrategy; import de.juplo.kafka.chat.backend.domain.ChatHomeService; import de.juplo.kafka.chat.backend.domain.ChatRoomFactory; import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatHomeService;