The bank paid, then timed out. Do you pay again?
transcript
A payout goes to the bank. The bank pays. Ravi gets 300 rupees. Then the reply is lost. The queue sees an error.
The queue sent a payout. It got back an error. A timeout. Did the bank fail before paying? Or after? The queue can't tell. Both look the same. Both are just an error. That is the trap.
If the queue retries, and the payout has no id, the bank pays again. With an id, the bank remembers it applied p2. The retry does nothing.
And a payout that never works? Try three times. Log every try. Then park it in the dead letters. Don't retry for ever. A person can see it, fix the bank, and send it again. Nothing is lost.
Retries are only safe if repeats are ignored. Otherwise, they pay twice. So the id travels with the command. The bank checks it every time.
Full breakdown in the lecture.