Published events are transactionally captured in an outbox-table
authorKai Moritz <kai@juplo.de>
Sun, 25 Oct 2020 15:45:39 +0000 (16:45 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 7 Feb 2021 14:12:28 +0000 (15:12 +0100)
commit136347c46acdb74268e882919f3b811a64b58f90
tree4930dc0fa660becbb264955d111edc3669d25ee2
parent9326ab1848e9c96888343410939e636b0ea974b0
Published events are transactionally captured in an outbox-table

* The outbox-implementation it kept separated from the application:
  the application sends a normal ApplicationEvent - everything else
  is implemented in a separate package, that could be packaged and
  distributed separatedly
* Created a new table outbox
* Added the event-type OutboxEvent, which is captured in the outbox
* UserEvent is now a subclass of OutboxEvent
* Added an OutboxListener that transactionally captures the events
README.sh
src/main/java/de/juplo/boot/data/jdbc/Application.java
src/main/java/de/juplo/boot/data/jdbc/UserController.java
src/main/java/de/juplo/boot/data/jdbc/UserEvent.java
src/main/java/de/juplo/boot/data/jdbc/UserEventListener.java
src/main/java/de/juplo/kafka/outbox/OutboxEvent.java [new file with mode: 0644]
src/main/java/de/juplo/kafka/outbox/OutboxListener.java [new file with mode: 0644]
src/main/java/de/juplo/kafka/outbox/OutboxRepository.java [new file with mode: 0644]
src/main/resources/db/migration/h2/V2__Table_outbox.sql [new file with mode: 0644]
src/main/resources/db/migration/postgres/V2__Table_outbox.sql [new file with mode: 0644]