Hypothetical scenario. Northwind’s worker updates search, then loses its connection before acknowledging the item. A replacement receives the same delivery. Dev suggests acknowledging first next time; Priya places a worker crash immediately after that early acknowledgement.
Dev: “That would stop the repeated delivery.”
Priya: “Would it also leave an accepted update without its required effect?”
Trace both crash windows against the obligation from page 19. Separate publisher confirmation, consumer acknowledgement and the external search effect. Count logical work and attempts separately so recovery does not look like unexplained extra demand.
Which fact does each acknowledgement establish?
A publisher confirmation concerns a producer’s interaction with a broker under the selected publication contract. A consumer acknowledgement tells the broker how to treat an item delivered to a consumer. Neither alone proves that Northwind’s external search projection changed correctly.
RabbitMQ’s acknowledgement and confirmation guide documents these distinct mechanisms. Identify which signal the application records at each stage. A healthy publisher connection, a retained message and a finished business effect are three different facts.
The product response still promises a stored edit and its durable processing intent. Search readiness is tracked separately. A broker can do exactly what its configuration requests while an application acknowledges too early or loses the connection between delivery identity and the intended update.
Trace the crash windows
If a worker acknowledges before applying the effect, then crashes, the broker may consider the delivery complete even though the projection remains old. If it applies the effect before acknowledging, then crashes, delivery can recur even though the projection already changed. Moving the acknowledgement exchanges one gap for another.
A recoverable design makes repeated delivery safe under the operation’s meaning. For a full product-search representation, a logical identity can combine product identity, source version and projection schema version. Repeating that same operation means trying to establish the same intended representation, not creating another product edit.
Place the once-only claim at its real boundary
Hypothetical scenario. Worker W receives E12, writes the search representation and crashes before its consumer acknowledgement. Broker redelivery is correct because the broker never learned that W finished. Moving acknowledgement earlier would create a different window in which accepted work disappears before its effect.
| Crash boundary | Broker knowledge | Recovery requirement |
|---|---|---|
| Before target commit | Unacknowledged | Retry same identity |
| After target; before ack | Unacknowledged | Detect already-applied effect |
| Remote reply lost | No local success evidence | Lookup / reconcile original operation |
For a target transaction entirely inside one database, an inbox identity and the business update can commit together. A separate inbox flag written before an external HTTP effect is insufficient: a crash can leave the flag without the effect. Writing it afterward leaves the opposite ambiguity. Remote success with a lost response requires the remote service's operation identity and lookup or reconciliation contract.
Kafka transactions can bind selected log writes and offsets under their documented scope. They do not turn an unrelated payment provider or search API into the same transaction. Keep poison-work quarantine as an unfinished or deliberately rejected obligation with reason and owner. A broker queue reaching zero does not prove every accepted logical job completed.
Protect the effect, not only a worker flag
An in-memory “seen” set disappears with its process and does not coordinate several workers. A separate durable seen record also needs careful placement. Recording seen before the effect can lose work; recording it afterward can leave a duplicate-effect window if the two operations do not share an atomic boundary.
Where the effect is in the same database, the application can seek a local transaction that binds the relevant state and operation identity. Where the effect is external, require a supported conditional operation or an identity/status contract at that service. A local flag cannot retroactively make an external call atomic.
For this hypothetical projection design, require the target to reject an older source version from overwriting a newer complete representation. If version 9 is already applied, a delayed full version 8 should not replace it. This is a required target contract to establish, not an assertion that every indexing API implements it automatically.
Full snapshots and deltas have different rules. Replacing a representation with a newer complete snapshot may supersede an older snapshot. Skipping an increment or a required intermediate action may change the result. Define the operation before selecting a deduplication or version comparison strategy.
Count the extra attempts
Hypothetical worked example. Choose twenty logical search-update jobs. Sixteen complete on the first attempt, three on their second and one on its third. Attempts total 16 × 1 + 3 × 2 + 1 × 3 = 25. Additional attempts are 25 − 20 = 5, while successful logical effects remain twenty under the declared protection contract.
The selected average is 25 ÷ 20 = 1.25 attempts per logical job. At the earlier two logical jobs per second, that mix would require 2 × 1.25 = 2.5 attempts per second. This assumes the same attempt pattern continues and ignores differences in attempt cost; the selected cohort is not a production retry statistic.
Now introduce a separate measured quantity the design would need: attempt-processing capacity. For the exercise, choose three attempts per second, with the same selected 1.25-attempt mix. Logical completion capacity is 3 ÷ 1.25 = 2.4 jobs per second. Net recovery margin against two incoming jobs is 2.4 − 2 = 0.4 per second.
The previous hundred-job backlog would then need 100 ÷ 0.4 = 250 seconds to empty in this revised fixed-rate model. This does not contradict the prior hundred-second calculation: that calculation assumed three qualifying logical completions per second. Attempt capacity is a different unit, and observing retries requires revisiting the capacity assumption.
Bound recovery without abandoning the obligation
Retry transient failures under an explicit delay, attempt and age policy. Repeated immediate retries can consume capacity needed for useful work. A permanently malformed item needs inspection or quarantine rather than an endless loop that blocks unrelated updates.
A dead-letter destination is a place to retain and inspect failed work. It does not mean the product obligation completed. Preserve the original identity, failure evidence and a supported replay decision. Correcting a payload and replaying it must respect whether the original effect may already have happened.
Ordering has a declared scope
A queue’s publication or delivery order does not automatically determine effect completion order across several workers. One slow job can finish after a later job. If product-version order matters, enforce the required rule at the state transition or choose processing organization that establishes it under failure.
Do not impose a global order merely because one product needs ordered updates. That can unnecessarily serialize unrelated products. Equally, do not claim per-key order without explaining how redelivery, ownership changes and parallel workers preserve the selected rule.
In the wild: broker success stops at its boundary
RabbitMQ’s documented separation of confirmations and acknowledgements gives a practical way to review the transport path. Northwind still owns how an acknowledged delivery maps to a valid projection effect. The broker is not the authority for whether a source version is eligible to replace another one.
Hypothetical failure scenario. The worker applies version 9, crashes before acknowledging, then receives an older version 8 ahead of the redelivered version 9. A handler blindly overwrites the search record on every delivery. The queue recovers messages successfully while the application regresses the representation.
Use the operation’s source version and protected target transition to prevent that regression, retaining enough evidence to inspect ambiguous outcomes. Requeueing the same payload more aggressively does not correct the missing version contract.
Choose delivery for the effect
Use recoverable delivery when delayed completion and repeated attempts are acceptable under a protected effect contract. A single process’s execution history is insufficient evidence for a distributed once-only claim. Keep unfinished, rejected and uncertain work distinct from completed logical operations.
Northwind now has an identity and recovery rule for one update obligation. The next lesson asks whether the transport should behave as a competing-work queue, a retained event stream or a publish-subscribe distribution path. Those choices change who receives work and what can be replayed.
Challenge the proposed mechanism
An inbox says E12 started, but the remote service has no result. May the worker mark it complete?
Reveal the design reasoning
No. Started is not completed. Reconcile through the remote operation identity or retain uncertainty for an authorized recovery path. The answer must state the effect boundary before making any once-only claim.
Decision and reconsideration: Choose delivery and recovery around the effect contract. Report logical completions, attempts and uncertain outcomes separately.
Recover the same obligation
Will acknowledging before the effect eliminate the recovery problem?
Move the crash point
No. A crash after that acknowledgement can leave the effect missing while delivery is considered complete. Protect the effect and identity rather than relocating the gap.
Do twenty-five attempts imply twenty-five logical updates?
Count identities and attempts separately
No. In the selected cohort, twenty identities require twenty-five attempts. Correct protection permits retries without creating five additional business effects.
May a newer complete snapshot always replace every earlier event?
Inspect the operation’s meaning
Only under a contract where that snapshot contains all required state. Deltas, increments and required intermediate effects cannot be silently discarded by the same rule.
Recovery defines how one responsibility survives repeated attempts. Page 21 adds independent responsibilities and asks whether each needs every change or merely a share of competing work.
Northwind decision log
Keep publisher confirmation, consumer acknowledgement and effect completion separate.
Reuse one logical operation identity and enforce the target’s version contract.
Recalculate recovery capacity in attempts when retries add work.
Go deeper: uncertainty around effects
- Book chapter: Designing Event-Driven Systems, chapter 11: Consistency and Concurrency in Event-Driven Systems — Ben Stopford. Connect single-writer and identity choices to processing.
- Book chapter: The same book, chapter 12: Transactions, but Not as We Know Them — Ben Stopford. Inspect the scope of atomic processing and duplicate handling.
- Video lecture: Distributed Systems 1.3: RPC — Martin Kleppmann. Follow remote calls whose outcome is uncertain to the caller.
- Primary document: Consumer Acknowledgements and Publisher Confirms — RabbitMQ. Identify exactly what each broker interaction establishes.