Introduction
Event-driven applications are designed around a simple idea: one system produces an event and another system reacts to it.
For example:
Order Service
|
v
Order Created Event
|
v
Amazon EventBridge
|
+----> Billing
+----> Notifications
+----> Analytics
This architecture reduces direct dependencies between services, but it introduces an operational challenge: events can fail to reach or process successfully at the destination.
A consumer may be temporarily unavailable, a downstream API may return an error, or an event handler may contain a software defect.
Recovery therefore needs to be part of the event architecture.
Amazon EventBridge provides capabilities such as event delivery retries, dead-letter queues, and event replay that can help applications recover from failures. Ordering is a separate concern and should be designed carefully because event-driven systems should not assume that every event arrives in the order it was created.
This article explains how ordering, retries, dead-letter queues, and replay fit together and how to design a reliable recovery process.
Why Event Ordering Matters
Consider an order workflow:
Event 1: OrderCreated
Event 2: PaymentCompleted
Event 3: OrderShipped
The consumer expects:
OrderCreated
↓
PaymentCompleted
↓
OrderShipped
If events are processed out of order:
OrderCreated
↓
OrderShipped
↓
PaymentCompleted
the consumer may temporarily or permanently reach an invalid state.
However, ordering is not automatically required for every event-driven system.
For example, independent events such as:
UserViewedProduct
UserOpenedPage
may not need strict ordering.
The first design question should therefore be:
Does the business process actually depend on event order?
EventBridge Delivery and Consumer Failures
An event can be successfully accepted by the event bus while downstream processing still fails.
A simplified flow is:
Producer
|
v
EventBridge Event Bus
|
v
Rule
|
v
Target
|
+---- Success
|
+---- Failure
The failure may happen because:
The target is unavailable
The target returns an error
A network dependency fails
The consumer times out
The consumer has a software bug
The event payload is invalid for the current consumer version
A reliable architecture needs a way to distinguish temporary failures from events that require investigation.
Retries Help With Temporary Failures
A transient failure does not necessarily mean that an event is permanently invalid.
For example:
Event
|
v
Consumer
|
X---- Temporary failure
|
v
Retry
|
v
Consumer
|
v
Success
EventBridge supports retry behavior for target delivery failures.
The exact retry configuration should be chosen according to the target and business requirements.
The important principle is that retries should address transient failures, not hide permanent failures indefinitely.
Dead-Letter Queues Capture Failed Events
Eventually, an event may continue failing.
A dead-letter queue (DLQ) provides a place to retain events that could not be successfully delivered after the configured retry behavior.
The architecture becomes:
EventBridge
|
v
Target
|
+---- Success
|
+---- Retry
|
+---- Success
|
+---- Failure
|
v
DLQ
This prevents permanently failing events from disappearing silently.
A DLQ also gives operations teams an opportunity to investigate and recover events later.
What Event Replay Adds
A DLQ preserves failed events, but recovery still requires a way to process them.
Event replay provides another mechanism for reprocessing archived events.
A simplified recovery flow is:
Event Archive
|
v
Replay
|
v
EventBridge
|
v
Target
This can be useful after:
A consumer bug is fixed
A downstream service recovers
A deployment introduced a temporary failure
A new consumer needs historical events
An event-processing rule needs to be corrected
Replay should be treated as a controlled operational process rather than an automatic replacement for retries.
Retry vs DLQ vs Replay
These mechanisms solve different problems.
Mechanism | Primary purpose | Typical timing |
|---|---|---|
Retry | Recover from temporary target failure | Immediately/automatically |
DLQ | Preserve events that could not be delivered | After delivery failures |
Archive | Retain events for future use | Before a recovery need |
Replay | Reprocess retained historical events | Deliberately initiated |
Application retry | Recover from downstream business/API failure | Consumer-controlled |
Understanding this distinction prevents teams from trying to use one mechanism for every failure mode.
A Production Recovery Architecture
A robust architecture might look like:
Event Producer
|
v
EventBridge Bus
|
+------------+------------+
| |
v v
Rule A Rule B
| |
v v
Consumer A Consumer B
| |
+---+---+ +---+---+
| | | |
Success Retry Success Retry
| |
v v
DLQ DLQ
Event Archive
|
v
Replay
This architecture separates normal delivery from recovery.
Do Not Assume Replay Solves Ordering
Replay can reprocess events, but replaying events does not automatically solve application-level ordering requirements.
Suppose the original events were:
1. CustomerCreated
2. AddressUpdated
3. CustomerDeleted
If the consumer processes them incorrectly, replaying the events without understanding state transitions may reproduce the same problem.
Join the conversation! Your thoughts help the community grow.