Grokking Spring Boot
Vote

0% completed

​

The Transactional Outbox

A service that saves a booking to its database and announces it on Kafka can order those two writes in only two ways:

  1. Send the message, then commit the booking.
  2. Commit the booking, then send the message.

Kafka with Spring used the second order, and a broker outage lost every confirmation sent during it. The first order fails in the opposite direction. Neither order is safe, because the database and the broker cannot commit together.

The fix is to stop writing to two systems in the request

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content