demos/kafka/chat
2 months agotest: Added IT for `ChatRoomRepository` and `MessageRepository` rebase--2024-02-22
Kai Moritz [Wed, 21 Feb 2024 16:34:56 +0000 (17:34 +0100)]
test: Added IT for `ChatRoomRepository` and `MessageRepository`

2 months agofeat: Added logging for io.projectreactor to `MongoDbStorageStrategy`
Kai Moritz [Tue, 20 Feb 2024 16:35:14 +0000 (17:35 +0100)]
feat: Added logging for io.projectreactor to `MongoDbStorageStrategy`

2 months agorefactor: DRY for logging-category from io.projectreactor
Kai Moritz [Tue, 20 Feb 2024 16:32:54 +0000 (17:32 +0100)]
refactor: DRY for logging-category from io.projectreactor

2 months agofeat: Added counting of restored instances
Kai Moritz [Tue, 20 Feb 2024 15:14:22 +0000 (16:14 +0100)]
feat: Added counting of restored instances

2 months agorefactore: Refined success/error-handling for restore-operations
Kai Moritz [Tue, 20 Feb 2024 15:12:00 +0000 (16:12 +0100)]
refactore: Refined success/error-handling for restore-operations

2 months agorefactor: Cleaned up code
Kai Moritz [Tue, 20 Feb 2024 12:05:21 +0000 (13:05 +0100)]
refactor: Cleaned up code

2 months agofeat: Introduced counting of stored instances in `StorageStrategy`
Kai Moritz [Tue, 20 Feb 2024 12:02:09 +0000 (13:02 +0100)]
feat: Introduced counting of stored instances in `StorageStrategy`

2 months agofeat: Introduced config-parameters for the `io.projectreactor`-logging
Kai Moritz [Tue, 20 Feb 2024 11:48:40 +0000 (12:48 +0100)]
feat: Introduced config-parameters for the `io.projectreactor`-logging

2 months agorefactor: Set logging-level for io.projectreactor to `DEBUG`
Kai Moritz [Tue, 20 Feb 2024 10:43:00 +0000 (11:43 +0100)]
refactor: Set logging-level for io.projectreactor to `DEBUG`

2 months agorefactor: Refined stream-definition in `StorageStrategy#write`
Kai Moritz [Tue, 20 Feb 2024 10:28:22 +0000 (11:28 +0100)]
refactor: Refined stream-definition in `StorageStrategy#write`

* Changed the stream-definition to a more natural order.
* As a result, the stored `ChatRoomInfo`-instances do not have to be
  handed clumsily to the following stream.

2 months agorefactor: Refined return-type of `StorageStrategy#write`
Kai Moritz [Tue, 20 Feb 2024 10:14:43 +0000 (11:14 +0100)]
refactor: Refined return-type of `StorageStrategy#write`

2 months agorefactor: One stream -> using `flatMap` instead of an inner `subscribe`
Kai Moritz [Tue, 20 Feb 2024 07:50:56 +0000 (08:50 +0100)]
refactor: One stream -> using `flatMap` instead of an inner `subscribe`

2 months agorefactor: Moved succes/error-logging to outer stream-definitions
Kai Moritz [Tue, 20 Feb 2024 07:23:13 +0000 (08:23 +0100)]
refactor: Moved succes/error-logging to outer stream-definitions

2 months agorefactor: Simplified `StorageStrategy`
Kai Moritz [Tue, 20 Feb 2024 06:47:22 +0000 (07:47 +0100)]
refactor: Simplified `StorageStrategy`

* Reconfigurable success/error-logging was introduced for
  `NoStorageStorageStrategy`.
* But as it turns out, this strategy can simply apply its logging in the
  overwritten method, that disables the whole storing-logic.
* Hence, the interface was greatly simplified again, by removing this
  ununsed mechanism.

2 months agorefactor: Moved extracted the `subscribe()`-call from `StorageStrategy`
Kai Moritz [Mon, 19 Feb 2024 14:01:58 +0000 (15:01 +0100)]
refactor: Moved extracted the `subscribe()`-call from `StorageStrategy`

* The subscription does no more happen inside the implementations of the
  interface `StorageStrategy`.
* Instead, the methods, that are defined in `StorageStrategy` return the
  created `Flux`.
* The call to `subscribe()` happens in the code, that uses this methods.
* This faciliates feature refinements concerning the asynchronous handling
  of success- and error-cases and so forth.

2 months agorefactor: Extracted subscription into a separate method-call
Kai Moritz [Sat, 3 Feb 2024 23:37:23 +0000 (00:37 +0100)]
refactor: Extracted subscription into a separate method-call

* This is in preparation to a planed refinement.
* The refinment will move the `subscribe()`-call out of the implementation
  of the `StorageStrategy`.

2 months agotest: Added missing JSR-310 module to not Spring-Boot-based tests
Kai Moritz [Mon, 19 Feb 2024 13:50:34 +0000 (14:50 +0100)]
test: Added missing JSR-310 module to not Spring-Boot-based tests

2 months agofeat: Added log message for disabled storage
Kai Moritz [Mon, 19 Feb 2024 13:31:21 +0000 (14:31 +0100)]
feat: Added log message for disabled storage

2 months agofix: Without `@DirtiesContext` the app is not teared down correctly
Kai Moritz [Sun, 18 Feb 2024 19:12:19 +0000 (20:12 +0100)]
fix: Without `@DirtiesContext` the app is not teared down correctly

* `StorageStrategy` depends on Spring to call the method
  `ChatBackendApplication#onExit()`, that is annotated with `@PreDestroy`.
* If this method is not called, the strategy is not applied, which leads
  to errors in the integration-tests.
* This happens, if all tests are run through Maven, because Spring
  recycles the application-context and only tears down the context after
  all tests have run.
* The addition of `@DirtiesContext` on those tests forces Spring to tear
  down the application completely after each so annotated test.
* Hence, the method is called as expected, which fixes the described
  errors.

2 months agotest: Introduced integration-tests for `NoStorageStorageStrategy`
Kai Moritz [Mon, 19 Feb 2024 10:05:17 +0000 (11:05 +0100)]
test: Introduced integration-tests for `NoStorageStorageStrategy`
--
ALIGN

2 months agotest: Introduced integration-tests for `NoStorageStorageStrategy`
Kai Moritz [Mon, 19 Feb 2024 10:01:13 +0000 (11:01 +0100)]
test: Introduced integration-tests for `NoStorageStorageStrategy`
--
COPY

2 months agorefactor: Extracted annonymous class into `NoStorageStorageStrategy`
Kai Moritz [Mon, 19 Feb 2024 12:07:35 +0000 (13:07 +0100)]
refactor: Extracted annonymous class into `NoStorageStorageStrategy`
--
ALIGN

2 months agorefactor: Extracted annonymous class into `NoStorageStorageStrategy`
Kai Moritz [Mon, 19 Feb 2024 12:05:51 +0000 (13:05 +0100)]
refactor: Extracted annonymous class into `NoStorageStorageStrategy`
--
COPY

2 months agorefactor: Added success- and failure-callbacks for `ChatHomeService`
Kai Moritz [Sun, 18 Feb 2024 20:46:56 +0000 (21:46 +0100)]
refactor: Added success- and failure-callbacks for `ChatHomeService`

2 months agorefactor: Added success- and failure-callbacks to `StorageStrategy`
Kai Moritz [Sat, 3 Feb 2024 21:44:02 +0000 (22:44 +0100)]
refactor: Added success- and failure-callbacks to `StorageStrategy`

2 months agorefactor: `KafkaServicesApplicationRunner` aufgeräumt
Kai Moritz [Sat, 3 Feb 2024 19:43:29 +0000 (20:43 +0100)]
refactor: `KafkaServicesApplicationRunner` aufgeräumt

2 months agofix: Config-ITs do not fail, if run multiple times
Kai Moritz [Sat, 3 Feb 2024 11:08:15 +0000 (12:08 +0100)]
fix: Config-ITs do not fail, if run multiple times

2 months agofix: Removed manual version-management for testcontainers.org
Kai Moritz [Sat, 3 Feb 2024 07:35:38 +0000 (08:35 +0100)]
fix: Removed manual version-management for testcontainers.org

2 months agofeat: Upgraded Spring Boot 3.1.3 -> 3.2.2
Kai Moritz [Sat, 3 Feb 2024 07:32:40 +0000 (08:32 +0100)]
feat: Upgraded Spring Boot 3.1.3 -> 3.2.2

2 months agofix: `getChatRoomInfo()` thrwos `LoadInProgressException` when loading
Kai Moritz [Sat, 3 Feb 2024 16:25:45 +0000 (17:25 +0100)]
fix: `getChatRoomInfo()` thrwos `LoadInProgressException` when loading

- The method `InfoChannel.getChatRoomInfo(UUID)` has to check, if loading
  is in process.
- Otherwise, an existing chat-room might erronously not be found, if it is
  requested, while `InfoChannel` is loading, because it is not yet loaded.

2 months agorefactor: compute `loadInProgress` on offset-change
Kai Moritz [Sat, 3 Feb 2024 14:32:25 +0000 (15:32 +0100)]
refactor: compute `loadInProgress` on offset-change

2 months agorefactor: separated message- and record- (aka offset-) handling
Kai Moritz [Sat, 3 Feb 2024 14:20:25 +0000 (15:20 +0100)]
refactor: separated message- and record- (aka offset-) handling

2 months agorefactor: Renamed method in `InfoChannel` according to conventions
Kai Moritz [Sat, 3 Feb 2024 14:13:09 +0000 (15:13 +0100)]
refactor: Renamed method in `InfoChannel` according to conventions

2 months agorefactor: Made only locally used method in `KafkaChatHomeService` private
Kai Moritz [Sat, 3 Feb 2024 14:11:50 +0000 (15:11 +0100)]
refactor: Made only locally used method in `KafkaChatHomeService` private

2 months agofeat: The position of the last seen messages is stored on a revoke
Kai Moritz [Sun, 24 Sep 2023 19:42:22 +0000 (21:42 +0200)]
feat: The position of the last seen messages is stored on a revoke

2 months agofix: The actual position has to be requested from the consumer
Kai Moritz [Sun, 24 Sep 2023 19:39:01 +0000 (21:39 +0200)]
fix: The actual position has to be requested from the consumer

* If the last seen offset and the current offset differ, although the
  partition did not contain any messages between this offsets, the loading
  process got stuck, because the position never advanced.
* Therefore, the actual position, that is compared against the read
  end-offset, has to be requested from the consumer.

2 months agorefactor: Added logging of loaded messages
Kai Moritz [Sun, 24 Sep 2023 19:38:46 +0000 (21:38 +0200)]
refactor: Added logging of loaded messages

2 months agorefactor: Refined success/error-handling when publishing shard-ownership
Kai Moritz [Tue, 20 Feb 2024 09:26:25 +0000 (10:26 +0100)]
refactor: Refined success/error-handling when publishing shard-ownership

2 months agofeat: Implemented `HaproxyShardingPublisherStrategy`
Kai Moritz [Sun, 17 Sep 2023 09:31:22 +0000 (11:31 +0200)]
feat: Implemented `HaproxyShardingPublisherStrategy`

* Implemented a first simple `ShardingPublisherStrategy`, that uses the
 https://www.haproxy.com/documentation/haproxy-runtime-api/[HAProxy Runntime API]
 to publish changed ownerships.
* Added configuration-properties `kafka.haproxyRuntimeApi` and
  `kafka.haproxyMap` to configure the strategy.

2 months agofeat: Introduced interface `ShardingPublisherStrategy`
Kai Moritz [Tue, 20 Feb 2024 08:53:10 +0000 (09:53 +0100)]
feat: Introduced interface `ShardingPublisherStrategy`

* The interface is used by `DataChannel` to publish the changed ownership
  each time, a new partition is assigned to the consumer-group.
* Added a dummy-implementation in `KafkaServicesConfiguration`.

2 months agofeat: Introduced a configurable instance-id
Kai Moritz [Tue, 20 Feb 2024 08:48:03 +0000 (09:48 +0100)]
feat: Introduced a configurable instance-id

2 months agofix: `ConsumerTaskRunner` waits until the data-loading is finished
Kai Moritz [Fri, 22 Sep 2023 16:20:31 +0000 (18:20 +0200)]
fix: `ConsumerTaskRunner` waits until the data-loading is finished

2 months agofeat: Introduced events that are send, if a shard is assigned/revoked
Kai Moritz [Sat, 16 Sep 2023 19:40:45 +0000 (21:40 +0200)]
feat: Introduced events that are send, if a shard is assigned/revoked

* In order to redirect requests to the appropriate instances, each
  instance must know the mapping from  shard-IDs to instance-URIs.
** For the static `in-memory`-implementation `ShardedChatHomeService`,
   this is a static mapping, that can be configured and read on start-up.
** For the dynamic `KafkaChatHomeService`, this mapping has to be
   propageted to all instances each time the partition-assignment of the
   consumer-group changes.
* Changes for `ShardedChatHomeService`
** Introduced `ChatBackendProperties.shardOwners` (of type `URI[]`).
** Each instance reads the static mapping from shard-ID to instance-URI
   on start-up.
* Changes for `KafkaChatHomeService`
** Introduced `KafkaServicesProperties.instanceUri` (of type `URI`).
** Each instance reads its URI on start-up.
** `DataChannel` sends an event for each assigned/removed partition,
   when the partition-assignment of the consumer-group changes.
** These events propagete the changed mapping from partition-ID to
   instance-URI.
** `InfoChannel` receives these events and updates the dynamic mapping
   from partition-ID (aka:shard-ID) to instance-URI.
* The shards, that are owned by an instance, can be queried via `/shards`.

2 months agofix: `metadata` is never `null`
Kai Moritz [Sun, 28 Jan 2024 17:50:33 +0000 (18:50 +0100)]
fix: `metadata` is never `null`

2 months agorefactor: DRY for computation of new `ChatRoomData` instances
Kai Moritz [Fri, 15 Sep 2023 19:35:17 +0000 (21:35 +0200)]
refactor: DRY for computation of new `ChatRoomData` instances

2 months agofix: GREEN - `DataChannel` creates entries for existent chat-rooms
Kai Moritz [Fri, 15 Sep 2023 18:56:14 +0000 (20:56 +0200)]
fix: GREEN - `DataChannel` creates entries for existent chat-rooms

2 months agotest: RED - Putting a message in a newly created chat-room
Kai Moritz [Fri, 15 Sep 2023 18:04:01 +0000 (20:04 +0200)]
test: RED - Putting a message in a newly created chat-room

2 months agorefactor: Splitted test in `AbstractConfigurationIT` into smaler pieces
Kai Moritz [Fri, 15 Sep 2023 15:29:05 +0000 (17:29 +0200)]
refactor: Splitted test in `AbstractConfigurationIT` into smaler pieces

2 months agorefactor: Moved common test-code into helper-class `KafkaTestUtils` - ALIGN
Kai Moritz [Fri, 15 Sep 2023 15:08:33 +0000 (17:08 +0200)]
refactor: Moved common test-code into helper-class `KafkaTestUtils` - ALIGN

2 months agorefactor: Moved common test-code into helper-class `KafkaTestUtils` - COPY
Kai Moritz [Fri, 15 Sep 2023 08:57:55 +0000 (10:57 +0200)]
refactor: Moved common test-code into helper-class `KafkaTestUtils` - COPY

2 months agorefactor: Extracted interface `WorkAssignor` into separate file
Kai Moritz [Fri, 15 Sep 2023 08:48:28 +0000 (10:48 +0200)]
refactor: Extracted interface `WorkAssignor` into separate file

2 months agorefactor: Separated channels for data and info -- Refactored/aligned code
Kai Moritz [Tue, 12 Sep 2023 21:33:59 +0000 (23:33 +0200)]
refactor: Separated channels for data and info -- Refactored/aligned code

* Split `ChatRoomChannel` into `InfoChannel` and `DataChannel`
** `DataChannel` manages only data for chat-messages
** `InfoChannel` manages all info-data (at the moment only
   `EventChatRoomCreated`)
* Aligned test-setup for kafka-related tests

2 months agorefactor: Separated channels for data and info -- Moved/copied classes
Kai Moritz [Mon, 11 Sep 2023 16:36:05 +0000 (18:36 +0200)]
refactor: Separated channels for data and info -- Moved/copied classes

* Split `ChatRoomChannel` into `InfoChannel` and `DataChannel`
** `DataChannel` manages only data for chat-messages
** `InfoChannel` manages all info-data (at the moment only
   `EventChatRoomCreated`)
* Aligned test-setup for kafka-related tests

2 months agorefactor: Introduced `ConsumerTaskExecutor` -- Aligned code
Kai Moritz [Thu, 14 Sep 2023 21:42:59 +0000 (23:42 +0200)]
refactor: Introduced `ConsumerTaskExecutor` -- Aligned code

* Moved startup-logic in a separate class (`ConsumerTaskExecutor`), so
  that it is reusable more easily in test scenarios.
* `KafkaServicesApplicationRunner` is instanciated via `@Component`, so
  that it is _not_ instanciated automatically, if the configuration is
  triggered explicitly via `KafkaServicesConfiguration` in test scenarios.

2 months agorefactor: Introduced `ConsumerTaskExecutor` -- Copied class
Kai Moritz [Thu, 14 Sep 2023 21:41:46 +0000 (23:41 +0200)]
refactor: Introduced `ConsumerTaskExecutor` -- Copied class

2 months agorefactor: `KafkaChatHomeServiceTest` reuses regular startup-logic
Kai Moritz [Thu, 14 Sep 2023 21:17:48 +0000 (23:17 +0200)]
refactor: `KafkaChatHomeServiceTest` reuses regular startup-logic

2 months agorefactor: `KafkaServicesApplicationRunner` without autowireing
Kai Moritz [Wed, 13 Sep 2023 19:20:39 +0000 (21:20 +0200)]
refactor: `KafkaServicesApplicationRunner` without autowireing

2 months agorefactor: Renamed `ChatRoomService` into `ChatMessageService` -- ALIGNE
Kai Moritz [Mon, 11 Sep 2023 14:19:22 +0000 (16:19 +0200)]
refactor: Renamed `ChatRoomService` into `ChatMessageService` -- ALIGNE

2 months agorefactor: Renamed `ChatRoomService` into `ChatMessageService` -- MOVE
Kai Moritz [Mon, 11 Sep 2023 14:18:42 +0000 (16:18 +0200)]
refactor: Renamed `ChatRoomService` into `ChatMessageService` -- MOVE

2 months agorefactor: Removed unused methods
Kai Moritz [Mon, 11 Sep 2023 14:10:22 +0000 (16:10 +0200)]
refactor: Removed unused methods

2 months agorefactor: Renamed `persistence` into `implementation` - Aligned code
Kai Moritz [Wed, 6 Sep 2023 21:48:50 +0000 (23:48 +0200)]
refactor: Renamed `persistence` into `implementation` - Aligned code

2 months agorefactor: Renamed `persistence` into `implementation` - Moved classes
Kai Moritz [Wed, 6 Sep 2023 21:48:39 +0000 (23:48 +0200)]
refactor: Renamed `persistence` into `implementation` - Moved classes

2 months agorefactor: `storage` is not a sub-package of `persistence` - Aligned code
Kai Moritz [Wed, 6 Sep 2023 21:46:36 +0000 (23:46 +0200)]
refactor: `storage` is not a sub-package of `persistence` - Aligned code

2 months agorefactor: `storage` is not a sub-package of `persistence` - Moved classes
Kai Moritz [Wed, 6 Sep 2023 21:46:29 +0000 (23:46 +0200)]
refactor: `storage` is not a sub-package of `persistence` - Moved classes

2 months agorefactor: `ChatHome` is a service - Aligned code
Kai Moritz [Wed, 6 Sep 2023 21:41:37 +0000 (23:41 +0200)]
refactor: `ChatHome` is a service - Aligned code

2 months agorefactor: `ChatHome` is a service - Moved classes
Kai Moritz [Wed, 6 Sep 2023 21:41:27 +0000 (23:41 +0200)]
refactor: `ChatHome` is a service - Moved classes

2 months agorefactor: Moved exceptions into package `exceptions` - Aligned Code
Kai Moritz [Wed, 6 Sep 2023 21:38:28 +0000 (23:38 +0200)]
refactor: Moved exceptions into package `exceptions` - Aligned Code

2 months agorefactor: Moved exceptions into package `exceptions` - Moved classes
Kai Moritz [Wed, 6 Sep 2023 21:38:15 +0000 (23:38 +0200)]
refactor: Moved exceptions into package `exceptions` - Moved classes

2 months agorefactor: Moved `ShardingStrategy` into package `persistence` -- ALIGNE
Kai Moritz [Wed, 6 Sep 2023 21:36:06 +0000 (23:36 +0200)]
refactor: Moved `ShardingStrategy` into package `persistence` -- ALIGNE

2 months agorefactor: Moved `ShardingStrategy` into package `persistence` -- MOVE
Kai Moritz [Wed, 6 Sep 2023 21:35:35 +0000 (23:35 +0200)]
refactor: Moved `ShardingStrategy` into package `persistence` -- MOVE

2 months agorefactor: Splitted `ChatRoomInfo` and `ChatRoomData` - Aligned Code
Kai Moritz [Sun, 3 Sep 2023 17:54:46 +0000 (19:54 +0200)]
refactor: Splitted `ChatRoomInfo` and `ChatRoomData` - Aligned Code

3 months agorefactor: Splitted `ChatRoomInfo` and `ChatRoomData` - Moved classes
Kai Moritz [Sun, 3 Sep 2023 17:49:59 +0000 (19:49 +0200)]
refactor: Splitted `ChatRoomInfo` and `ChatRoomData` - Moved classes

3 months agotest: Refactored test-code
Kai Moritz [Tue, 5 Sep 2023 22:02:28 +0000 (00:02 +0200)]
test: Refactored test-code

3 months agorefactor: Simplified implementation - Removed interface `ChatRoomFactory`
Kai Moritz [Sat, 2 Sep 2023 17:16:26 +0000 (19:16 +0200)]
refactor: Simplified implementation - Removed interface `ChatRoomFactory`

* Moved method `ChatRoomFactory.createChatRoom(UUID, String)` to `ChatHome`.
* Allowed `null`-values for `ChatRoom.shard`.
* Moved logic from `InMemoryChatHomeService` into `SimpleChatHome` respective
  `ShardedChatHome` and removed obsolete class.
* Adapted the configuration of the tests to the model changes:

3 months agofeat: Upgraded Spring Boot 3.0.1 -> 3.1.3
Kai Moritz [Thu, 24 Aug 2023 17:24:54 +0000 (19:24 +0200)]
feat: Upgraded Spring Boot 3.0.1 -> 3.1.3

3 months agorefactor: `ShardNotOwnedException` should be send over `Mono.send()`
Kai Moritz [Tue, 29 Aug 2023 17:36:15 +0000 (19:36 +0200)]
refactor: `ShardNotOwnedException` should be send over `Mono.send()`

3 months agotest: Added tests for a chat-home _with_ shards
Kai Moritz [Tue, 22 Aug 2023 15:33:36 +0000 (17:33 +0200)]
test: Added tests for a chat-home _with_ shards

3 months agotest: Added tests for a chat-home (without shards)
Kai Moritz [Tue, 22 Aug 2023 15:33:36 +0000 (17:33 +0200)]
test: Added tests for a chat-home (without shards)

3 months agoLoadInProgressException - ALIGN
Kai Moritz [Tue, 29 Aug 2023 18:33:37 +0000 (20:33 +0200)]
LoadInProgressException - ALIGN

3 months agoLoadInProgressException - MOVE
Kai Moritz [Tue, 29 Aug 2023 18:33:15 +0000 (20:33 +0200)]
LoadInProgressException - MOVE

3 months agotest: Simplified `ChatBackendControllerTest`
Kai Moritz [Tue, 22 Aug 2023 15:33:36 +0000 (17:33 +0200)]
test: Simplified `ChatBackendControllerTest`

3 months agofeat: `UnknownChatroomException` records shard and owned shards
Kai Moritz [Mon, 21 Aug 2023 16:26:53 +0000 (18:26 +0200)]
feat: `UnknownChatroomException` records shard and owned shards

3 months agofix: GREEN - Correct handling of unknown chat-rooms in the Kafka-version
Kai Moritz [Sun, 20 Aug 2023 10:20:55 +0000 (12:20 +0200)]
fix: GREEN - Correct handling of unknown chat-rooms in the Kafka-version

3 months agotest: RED - Added a test for a put to a non-existent chat-room
Kai Moritz [Sat, 2 Sep 2023 08:35:39 +0000 (10:35 +0200)]
test: RED - Added a test for a put to a non-existent chat-room

3 months agofeat: first runnable implementation, that is based on Kafka
Kai Moritz [Sun, 22 Jan 2023 17:13:40 +0000 (18:13 +0100)]
feat: first runnable implementation, that is based on Kafka

8 months agorefactor: Removed Interface `ChatHomeService`
Kai Moritz [Mon, 21 Aug 2023 16:25:20 +0000 (18:25 +0200)]
refactor: Removed Interface `ChatHomeService`

8 months agorefactor: Moved implementation details out of `domain` -- Aligned code
Kai Moritz [Sun, 20 Aug 2023 10:57:41 +0000 (12:57 +0200)]
refactor: Moved implementation details out of `domain` -- Aligned code

8 months agorefactor: Moved implementation details out of `domain` -- Moved classes
Kai Moritz [Sun, 20 Aug 2023 10:57:26 +0000 (12:57 +0200)]
refactor: Moved implementation details out of `domain` -- Moved classes

8 months agofix: GREEN - Fixed NPE in `ShardedChatHome.getChatRoom()` for foreign shard
Kai Moritz [Fri, 18 Aug 2023 12:09:02 +0000 (14:09 +0200)]
fix: GREEN - Fixed NPE in `ShardedChatHome.getChatRoom()` for foreign shard

* `ShardedChatHome.getChatRoom(UUID)` know checks, if a `ChatHome` exists
  for the selected shard.
* If no `ChatHome` exists, a `ShardNotOwnedException` is thrown.
* The `ChatBackendControllerAdvice` translates the exception to an error
  of type 404 - NOT FOUND, to fullfill the defined expectations.

8 months agotest: RED - Proofed existence of an NPE in `ShardedChatHome.getChatRoom()`
Kai Moritz [Sat, 18 Feb 2023 10:07:21 +0000 (11:07 +0100)]
test: RED - Proofed existence of an NPE in `ShardedChatHome.getChatRoom()`

- Refined `AbstractConfigurationIT` to show, that an NPE can occure in
  `ShardedChatHome.getChatRoom()`.
- Defined the expected behaviour, if the NPE is handled correctly in the
  refined integration-test.

8 months agofeat: Implemented new Default-`StorageStrategy` `none'
Kai Moritz [Sat, 19 Aug 2023 15:33:03 +0000 (17:33 +0200)]
feat: Implemented new Default-`StorageStrategy` `none'

* If `none` is selected as storage strategy, an empty implementation of
  `Storage-Strategy` instanciated.
* The owned shardes are derived from the according configuration property.
* Before, they were derived from the stored data.

8 months agorefactor: `ChatRoomFactory` returns real `ChatRoom`s
Kai Moritz [Sun, 26 Feb 2023 14:30:20 +0000 (15:30 +0100)]
refactor: `ChatRoomFactory` returns real `ChatRoom`s

- `ChatHomeService` only deals with real `ChatRoom`s.
- Hence, there is no need for `ChatRoomFactory`, to return the simplified
  interface `ChatRoomInfo`.
- This is, because the implementation specific logic is implemented in the
  `ChatHomeService`, not `ChatHome` itself: the actual implementation is
  hidden behind that service (and behind the service `ChatRoomService` in
  the domain-class `ChatRoom`).

14 months agorefactor: Refined the creation of new `ChatRoom`s
Kai Moritz [Fri, 17 Feb 2023 23:21:50 +0000 (00:21 +0100)]
refactor: Refined the creation of new `ChatRoom`s

- Dropped `ChatHomeService.putChatRoom(ChatRoom)`.
- `ChatRoomFactory.create(UUID, String)` returns `ChatRoomInfo`.

14 months agorefactor: DRY for the configuration of the `AbstractStorageStrategyIT`
Kai Moritz [Fri, 17 Feb 2023 23:10:03 +0000 (00:10 +0100)]
refactor: DRY for the configuration of the `AbstractStorageStrategyIT`

14 months agorefactor: Refined the configuration of `AbstractStorageStrategyIT'
Kai Moritz [Fri, 17 Feb 2023 22:34:55 +0000 (23:34 +0100)]
refactor: Refined the configuration of `AbstractStorageStrategyIT'

15 months agorefactor: `ChatRoomService.persistMessage(..)` returns a `Mono<Message>`
Kai Moritz [Tue, 24 Jan 2023 18:05:18 +0000 (19:05 +0100)]
refactor: `ChatRoomService.persistMessage(..)` returns a `Mono<Message>`

15 months agorefactor: Simplified the handling of `MessageMutationException`
Kai Moritz [Wed, 25 Jan 2023 21:08:11 +0000 (22:08 +0100)]
refactor: Simplified the handling of `MessageMutationException`

15 months agotest: Added a test that assers disjunct chatrooms
Kai Moritz [Sun, 22 Jan 2023 17:34:21 +0000 (18:34 +0100)]
test: Added a test that assers disjunct chatrooms

15 months agochore: Added a Docker-Build
Kai Moritz [Sun, 15 Jan 2023 18:48:34 +0000 (19:48 +0100)]
chore: Added a Docker-Build

15 months agofeat: Reintroduced `ChatRoom.shard`, becaus it is needed as a routing-hint
Kai Moritz [Sat, 14 Jan 2023 18:53:16 +0000 (19:53 +0100)]
feat: Reintroduced `ChatRoom.shard`, becaus it is needed as a routing-hint

- Technically, the attribute is not needed.
- But, to implement the gua/sha-pattern, it is needed as routing-hing.
- Hence, it is reintroduced here and also added to the `ChatRoomTo` to
  be send to the client.