fix: The sink is recreated, if it gets canceled
authorKai Moritz <kai@juplo.de>
Sat, 7 Jan 2023 01:16:57 +0000 (02:16 +0100)
committerKai Moritz <kai@juplo.de>
Mon, 9 Jan 2023 19:55:49 +0000 (20:55 +0100)
commit8b36f121f0937f2fa1e991fe616312ab2d5c6bb4
tree79c6343c5f543e22f2223737d7a03d942567a48e
parentbeab02c115caf8db63779db0d336cc60aa298321
fix: The sink is recreated, if it gets canceled

- The sink is automatically cancelled, if the last consumer leaves.
- Turning auto-cancel of, is not an option, because this buffers new
  messages, until the buffer overflows, after which new messages are
  droped. Hence, if a new subscriber arrives, it would see some old
  messages and then, after a gap, current messages.
- Because of that, the sink is now automatically recreated, if the
  last subscriber leaves and triggers the automatically cancelation
  of the sink.
- The sink can be recreated without conflicts, because all methods,
  that may access the sink are synchronized.
src/main/java/de/juplo/kafka/chat/backend/domain/Chatroom.java