In this article, you will see an example of a project implementation based on the Transactional outbox, Inbox, and Saga event-driven architecture patt

Event-driven architecture on the modern stack of Java technologies

submited by
Style Pass
2024-10-09 13:00:04

In this article, you will see an example of a project implementation based on the Transactional outbox, Inbox, and Saga event-driven architecture patterns. The stack of technologies includes Kotlin, Spring Boot 3, JDK 21, virtual threads, GraalVM, PostgreSQL, Kafka, Kafka Connect, Debezium, CloudEvents, Caddy, Docker, and other tools.

In event-driven architecture (EDA), the interaction between services is carried out using events, or messages. A message can contain, for example, an update of some entity state or a command to perform a given action.

Transactional outbox is a microservices architecture design pattern that solves dual writes problem; the problem is that if some business event occurs in an application, we can’t guarantee the atomicity of the corresponding database transaction and sending of an event (to the message broker, queue, another service, etc.), for example:

if a service sends the event after committing the transaction, there is no guarantee that it won’t crash before sending the message.

Leave a Comment