Send messages are deleted individually after a crash
authorKai Moritz <kai@juplo.de>
Sun, 31 Jan 2021 21:24:16 +0000 (22:24 +0100)
committerKai Moritz <kai@juplo.de>
Sat, 6 Feb 2021 18:11:30 +0000 (19:11 +0100)
commit0e43103e1538e33878de0460d4caa3712a0ad592
treeca305cec26e96c1184289ef90b970c4c3f57bc37
parent7dffda91e6aac4bd67e4ae9722db0439e31359eb
Send messages are deleted individually after a crash

* If all messages with a sequence-number lower than or equal than the
  sequence number of a message already send are deleted, this can only
  be done for the lowest sequence-number seen accross all partitions
  without violating the at-least-once semantics.
* Deleting seen messages individually by specifying their id (aka
  sequence-number) explicitly in the delete-command allows to delete
  _all_ messages from the outbox, that have been seen on the topic,
  hence, achieving exactly-once-semantics even in the case of an
  unclean shutdown (aka crash) of the OutboxProducer
delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxProducer.java
delivery/src/main/java/de/juplo/kafka/outbox/delivery/OutboxRepository.java
delivery/src/main/java/de/juplo/kafka/outbox/delivery/Watermarks.java [deleted file]