Back to projects

Java · Java & Spring Boot reference system

Transactional Outbox Relay

Reliable transactional outbox processing with Java 21, Spring Boot, PostgreSQL, Kafka, leases, retries, and Testcontainers.

The challenge

Business data and broker events need reliable creation even though the database and Kafka do not share one transaction and crashes can happen at any time.

The result

A modular library with a Spring Boot starter and runnable order API demonstrating atomic outbox writes, at-least-once delivery, and explicit failure boundaries.

What this project demonstrates

Reviewable decisions instead of slogans.

  • Atomic business and outbox writes in one Spring transaction
  • PostgreSQL leases, compare-and-set transitions, and crash recovery
  • Kafka acknowledgements, stable partition keys, and bounded retries
  • Micrometer, Flyway, and PostgreSQL/Kafka Testcontainers

Technologies

  • Java 21
  • Spring Boot
  • PostgreSQL
  • Apache Kafka
  • Testcontainers
  • Virtual Threads