You can also implement it yourself in a Spring Boot 2 application using Spring’s ApplicationEvent and Transaction Synchronization.
You can follow below steps : -
-** Create an outbox table with columns for unique ID, event type, payload, and timestamp to persist events.
- Use a single database transaction to save both business data and the corresponding event to the outbox table.
- Implement a scheduled job to poll the outbox table, send unsent events to their destination, and then mark them as sent or delete them.
- Design event consumers to be idempotent, ensuring they can safely process duplicate messages without side effects.