Solid arrows: calls. Dashed: replies. Red: errors and crashes. Dashed blue boxes: database transactions; amber: the duplicate branch.
What to look for
- The event stays in
PROCESSING, and findPendingOutboxEvents returns it again. - Kafka ends up with two messages with the same
eventId: offsets 1 and 2. This is at-least-once delivery. - The unique key on
processed_events rejects the second INSERT; the ROLLBACK discards the payment.