Obsługa błędów i ponownych prób jest ważna dla niezawodnych konsumentów RabbitMQ — decydowanie, co zrobić, gdy przetwarzanie wiadomości się nie powiedzie (ponowić próbę, wysłać do dead-letter, czy odrzucić). Prawidłowa obsługa błędów zapobiega utracie wiadomości i zablokowanym konsumentom.
Problem
When a consumer fails to process a message (bad data, downstream failure, bug):
→ requeue forever → a "poison" message blocks the queue (retried endlessly)
→ discard → message LOST
→ crash → reprocess, possibly stuck again
→ need a deliberate strategy.
Strategie ponownych prób
✓ NACK + REQUEUE → reject and requeue for retry (but limit retries — don't requeue forever)
✓ RETRY WITH BACKOFF → retry transient failures with increasing delays (e.g. via a delayed
retry queue with TTL → requeue after a delay)
✓ RETRY LIMIT → track attempts; after N failures → DEAD LETTER (don't retry forever)
✓ Distinguish TRANSIENT (retry) vs PERMANENT (dead-letter immediately) failures
