Asked about The classic fundamentals

Why do queue handlers need to be idempotent?

An answer that works

Queues generally guarantee at-least-once delivery, so a message can be delivered twice after a failure or a timeout. If the handler is not idempotent, that duplicate does the work twice.

Reading an answer is not being able to give one. The section that teaches this is The classic fundamentals, 6 hours of Distributed systems.

Learn this properly