]> juplo.de Git - demos/kafka/chat/commit
fix: GREEN - Postponed the resetting of the sink
authorKai Moritz <kai@juplo.de>
Sun, 24 Mar 2024 19:34:07 +0000 (20:34 +0100)
committerKai Moritz <kai@juplo.de>
Mon, 25 Mar 2024 10:54:24 +0000 (11:54 +0100)
commiteca4429d77ebcb8c2413136105a889a54f39f9b1
tree93e3ac172faeb87975d07e6a1e7f7f19298e6c46
parent741cbe45c1e69da44fa15df9ede2039e82246822
fix: GREEN - Postponed the resetting of the sink

* The completion of a sink of an instance of `ChatRoomData`, that belongs
  to a revoked partition is postponed until the following partition-
  assignment happens.
* Also, the sink is only completed and recreated, if the partition it
  belongs to, was not assigned to the instance during
  `onPartitionsAssigned()` again.
* That way, listeners have a little more time to receive the messages, that
  were send shortly prior to the deactivation, and are not disturbed
  unnecessarily, if the partition is reassigned to the same instance again.
* *TODO:* Listeners still have to be enabled, to start listening on the
  responsible instance where they left of on the old instance, if they
  were to slow to receive all messages, before the sind was completed.
src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomData.java
src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java
src/test/java/de/juplo/kafka/chat/backend/domain/ChatRoomDataTest.java