Example implementation in Kotlin with Spring and PostgreSQL.
This repository is created specifically for the purpose of my article about the transactional outbox pattern. You can read it here:
- https://toporowicz.it/transactional-outbox-pattern-monolith-app
- https://dev.to/maciejtoporowicz/transactional-outbox-pattern-in-a-monolithic-application-1ooc
- PostgreSQL >= 9.5
- schema from
schema.sql
present in the database
Database host, port and credentials in src/main/resources/application.properties
Build the app using mvn clean install
and then run it using java -jar outbox-0.0.1-SNAPSHOT.jar
.
The app exposes a single HTTP endpoint POST /accounts
.
Make a request to it with a request body like:
{
"name": "Maciej",
"email": "[email protected]"
}
In up to 5 seconds you should see a log like:
Received event: AccountCreatedEvent(id=996b31e5-c8ad-45c0-97d0-744519b8c454, [email protected])