Quizzes@RabbitListener — Concept Check
intermediate
rabbitmq

@RabbitListener — Concept Check

Questions on @RabbitListener. @RabbitListener binds a method to a queue and deserialises the message automatically; supports batching, reply-to, and customisable error handlers with MessageRecoverer.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on @RabbitListener — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A developer wants to consume messages from multiple queues using a single method. Which annotation setup allows this?

    • A@RabbitListener(queue = "queue1, queue2")
    • B@RabbitListener(queues = { "queue1", "queue2" })
    • C@RabbitListener(queue = { "queue1", "queue2" })
    • D@RabbitListener(queues = "queue1, queue2")
  2. 2.A method annotated with @RabbitListener processes messages but fails to acknowledge them. What could be the consequence?

    • AMessages are lost without acknowledgment
    • BMessages are automatically acknowledged on method return
    • CMessages are sent to a dead-letter exchange immediately
    • DMessages remain unacknowledged and may be requeued
  3. 3.A developer uses @RabbitListener with ackMode set to 'MANUAL'. What additional step must they take?

    • AExplicitly call ack.acknowledge() after processing
    • BConfigure a MessageConverter
    • CUse @Header to extract AMQP headers
    • DDeclare queues using @QueueBinding
  4. 4.How can a developer handle errors for a specific @RabbitListener method?

    • ASet a custom ErrorHandler in the containerFactory
    • BUse @QueueBinding to specify error handling
    • CUse @ErrorHandler annotation on the method
    • DConfigure error handling in application.properties
  5. 5.A service uses @RabbitListener with concurrency set to 1. What is a likely outcome during high load?

    • AMessages are automatically batched
    • BMessages are processed in parallel
    • CMessage processing becomes a bottleneck
    • DMessages are lost due to overflow
  6. 6.What does @RabbitListener automatically handle when binding a method to a queue?

    • AManual acknowledgment of messages
    • BCreation of a custom ErrorHandler
    • CMessage deserialization via MessageConverter
    • DConfiguration of DLX arguments
  7. 7.A developer notices that messages are not being processed from a queue. They are using @RabbitListener with inline queue declaration. What might be the issue?

    • AThe queue or exchange might not exist
    • BThe ackMode is set to AUTO
    • CThe method is not annotated with @Header
    • DThe MessageConverter is missing
  8. 8.What is the role of MessageRecoverer in @RabbitListener?

    • AAutomatically retries message processing
    • BHandles failed messages by dead-lettering or logging
    • CManages the acknowledgment lifecycle
    • DConverts messages to a different format