0
0
Spring Bootframework~20 mins

Dead letter queues in Spring Boot - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Dead Letter Queue Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
What happens when a message is rejected without requeue in a Spring Boot RabbitMQ listener with DLQ configured?
Consider a Spring Boot application using RabbitMQ with a dead letter queue (DLQ) configured. If a message listener rejects a message without requeueing it, what is the expected behavior?
Spring Boot
public void listen(String message) {
    if(message.contains("fail")) {
        throw new RuntimeException("Processing failed");
    }
    System.out.println("Processed: " + message);
}
AThe message is sent to the dead letter queue for later inspection.
BThe message is discarded and lost permanently.
CThe message is requeued and retried indefinitely.
DThe message is logged but remains in the original queue.
Attempts:
2 left
💡 Hint
Think about what happens to messages that cannot be processed and are rejected without requeue.
📝 Syntax
intermediate
2:00remaining
Which Spring Boot annotation correctly configures a dead letter queue for a RabbitMQ listener?
You want to configure a dead letter queue for a RabbitMQ listener in Spring Boot. Which annotation usage is correct?
A@RabbitListener(queues = "myQueue", dlq = "myDLQ")
B@RabbitListener(queues = "myQueue", deadLetterExchange = "dlx")
C
@RabbitListener(bindings = @QueueBinding(value = @Queue(value = "myQueue", durable = true, arguments = {
    @Argument(name = "x-dead-letter-exchange", value = "dlx")
})))
D@RabbitListener(queues = "myQueue", deadLetterQueue = "myDLQ")
Attempts:
2 left
💡 Hint
Dead letter queues are configured via queue arguments in Spring AMQP.
state_output
advanced
2:00remaining
What is the state of the message after max retry attempts are exceeded with DLQ configured?
In a Spring Boot RabbitMQ setup with a dead letter queue and retry mechanism, what happens to a message after it exceeds the maximum retry attempts?
AThe message is moved to the dead letter queue for further analysis.
BThe message is marked as processed and ignored.
CThe message is deleted from the queue and lost.
DThe message is sent back to the original queue for infinite retries.
Attempts:
2 left
💡 Hint
Consider what happens when retries fail repeatedly in a system with DLQ.
🔧 Debug
advanced
2:00remaining
Why does the dead letter queue not receive messages despite configuration?
A Spring Boot application has a dead letter queue configured for RabbitMQ, but messages that fail processing are not appearing in the DLQ. What is the most likely cause?
AThe DLQ is not bound to the dead letter exchange.
BThe message TTL is set too high.
CThe listener method is not throwing exceptions on failure.
DThe original queue is missing the x-dead-letter-exchange argument in its declaration.
Attempts:
2 left
💡 Hint
Check the queue arguments and bindings carefully.
🧠 Conceptual
expert
3:00remaining
What is the primary benefit of using a dead letter queue in a Spring Boot microservice architecture?
Why is it important to use dead letter queues in a Spring Boot microservice system that processes messages asynchronously?
ATo permanently discard all failed messages and reduce queue size.
BTo isolate and analyze failed messages without blocking the main processing flow.
CTo automatically retry failed messages indefinitely until success.
DTo encrypt messages for secure transmission between services.
Attempts:
2 left
💡 Hint
Think about how failures should be handled without stopping the system.