Message Properties — Concept Check
Questions on Message Properties. AMQP properties include delivery-mode (persistent/transient), content-type, correlation-id, reply-to, expiration, headers, and priority — all set by the producer per message.
Questions in this quiz
8 questions on Message Properties — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer sets the expiration property of a message to "60000". What does this mean for the message?
- AIt will be discarded after 60 seconds if not consumed.
- BIt will never be discarded.
- CIt will be discarded immediately after consumption.
- DIt will be discarded after 60 seconds regardless of consumption.
2.In the RPC pattern, what is the role of the correlation-id?
- AIt links a response to the original request.
- BIt sets the message priority.
- CIt specifies the queue to send the response to.
- DIt determines the content type of the message.
3.A service uses a priority queue with messages having priority levels from 0 to 9. What happens if all messages have the same priority?
- AThey are processed based on correlation-id.
- BThey are processed randomly.
- CThey are processed based on content-type.
- DThey are processed in the order they arrive.
4.A developer mistakenly believes setting the reply-to property is unnecessary in the RPC pattern. What issue might this cause?
- AMessages will have incorrect content-type.
- BMessages will not have a correlation-id.
- CResponses cannot be routed back to the caller.
- DMessages will expire immediately.
5.What property should be set to ensure a message survives a broker restart?
- AContent-type to application/json
- BPriority to 9
- CExpiration to 60000
- DDelivery-mode to persistent
6.A developer sets a message's content-type to "application/json". What does this indicate?
- AThe message is persistent.
- BThe message will expire in 60 seconds.
- CThe message has a high priority.
- DThe message payload is in JSON format.
7.A message has a correlation-id but no reply-to property. What consequence does this have in an RPC setup?
- AThe message will not be processed by the server.
- BThe response cannot be routed back to the caller.
- CThe message will have a default priority of 0.
- DThe message will be discarded after 60 seconds.
8.A developer uses @RabbitListener to consume messages. How can they access individual header values?
- AUse the @Header annotation to extract values.
- BUse the reply-to property.
- CAccess them through the correlation-id.
- DSet the delivery-mode to transient.