Solid arrows: calls. Dashed: replies. Red: errors and crashes. Dashed blue boxes: database transactions; amber: the duplicate branch.
What to look for
- The DB commit already includes the
processed_events row and the payment. - Because offset 3 was not committed, Kafka delivers it again after the restart.
- The redelivery finds the
eventId and skips it: no second payment.