The Transactional outbox pattern implementation using an outbox table.
A separate Message Relay process publishes the events inserted into database to a message broker using the Polling publisher pattern.
- Java 17
- Spring Boot
- PostgreSQL, Flyway
- RabbitMQ
- JUnit 5, Mockito, JaCoCo
$ make compose-up
$ make dist
$ make run
$ http://localhost:15672
$ User: guest
$ Pass: guest
POST
/orders
(creates a new order)
{
"clientId": "796f5390-6a32-4f3f-a4f9-219cea1d5336",
"issuedDate": "2023-02-03",
"items": [
{
"productId": "7fba7340-d24f-4548-a327-add2cd2ad4a9",
"price": 3,
"quantity": 2
}
]
}
Code : 201 CREATED
{
"id": "7c08629a-4d23-4b6d-9363-b0f0d7303aa4",
"clientId": "796f5390-6a32-4f3f-a4f9-219cea1d5336",
"issuedDate": "2023-02-03",
"status": "CREATED",
"totalCost": 6,
"items": [
{
"id": "dcb9f5fe-7423-4542-857e-47ae71322cf3",
"productId": "7fba7340-d24f-4548-a327-add2cd2ad4a9",
"price": 3,
"quantity": 2,
"cost": 6
}
]
}