Spring Boot & Microservices (50 Qs)•Part 3: Microservices, Distributed Systems & Observability (25 - 35)
Spring Kafka: Idempotent Listeners and Dead Letter Queues (DLQ).
senior LevelSystem DesignRabbitMQApache Kafka
In Simple Words:
- Dead Letter Topic (DLT): When message processing fails after maximum retries (e.g. 3 attempts), Spring Kafka's
DeadLetterPublishingRecovererautomatically forwards the poison pill message to atopic.DLTtopic for human inspection. - Idempotency: Store consumed Kafka offsets or business idempotency keys (
order_id) in Redis/DB to prevent duplicate executions from message replays.