~learn.
0:00 / 1:14
W03 · Messaging and async

You fixed the bug and replayed the dead letter. It failed again.

transcript

A message lands in the dead letter queue. You find the bug. You fix it. You replay the message. It fails again.

Here's the message. One item in the order. Its quantity is the string five. The consumer expects a number. That's bug A. And notice what isn't there. No price. Hold that thought.

It failed because quantity was a string. You fix bug A. The consumer now converts strings to numbers. You replay the message to its topic. It fails again. Bug B. The consumer now requires a price field.

Price was a new requirement. The format evolved after this message was written. Messages outlive the code that produced them.

Fix one: check the message's version, and run the logic for that version. Fix two: migrate old messages to the new format as you replay them. Fix three: after N days, archive them. Too old to replay.

So every dead letter carries its schema version. Then replay knows what it's holding. Instead of failing blindly.

Full breakdown in the lecture.