0
0
RabbitMQdevops~20 mins

Headers exchange in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Headers Exchange Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Understanding headers exchange binding behavior
Given a headers exchange with a queue bound using headers {"x-match": "all", "format": "pdf", "type": "report"}, what happens when a message with headers {"format": "pdf", "type": "report"} is published?
AThe message is routed to the queue because all headers match.
BThe message is routed only if the message has an additional header 'x-match'.
CThe message is not routed because the x-match header is missing in the message.
DThe message is not routed because headers exchanges ignore the 'all' match type.
Attempts:
2 left
💡 Hint
Remember that 'x-match' defines how headers are matched between binding and message.
🧠 Conceptual
intermediate
2:00remaining
Headers exchange matching modes
Which statement correctly describes the difference between 'x-match' set to 'any' and 'all' in a headers exchange binding?
A'all' ignores header values; 'any' matches header values exactly.
B'any' requires all headers to match; 'all' requires at least one header to match.
C'all' requires all headers to match; 'any' requires at least one header to match.
D'any' matches only the first header; 'all' matches only the last header.
Attempts:
2 left
💡 Hint
Think about how strict the matching should be for routing.
Configuration
advanced
2:00remaining
Binding a queue with headers exchange using rabbitmqctl
Which rabbitmqctl command correctly binds a queue named 'reports' to a headers exchange 'docs_exchange' with headers {"x-match": "any", "format": "pdf", "type": "summary"}?
Arabbitmqctl set_binding docs_exchange reports '{"x-match":"any","format":"pdf","type":"summary"}'
Brabbitmqctl set_binding --queue=reports --exchange=docs_exchange --arguments='{"x-match":"any","format":"pdf","type":"summary"}' --type=headers
Crabbitmqctl bind_queue reports docs_exchange '{"x-match":"any","format":"pdf","type":"summary"}'
Drabbitmqctl set_binding --queue=reports --exchange=docs_exchange --arguments='{"x-match":"any","format":"pdf","type":"summary"}'
Attempts:
2 left
💡 Hint
Headers exchange requires specifying the exchange type and arguments correctly.
Troubleshoot
advanced
2:00remaining
Diagnosing message routing failure in headers exchange
A message with headers {"format": "pdf", "type": "report"} is published to a headers exchange. The queue is bound with headers {"x-match": "all", "format": "pdf", "type": "summary"}. Why is the message not routed to the queue?
AThe queue is not bound to the exchange properly.
BThe message lacks the 'x-match' header, so it is rejected.
CHeaders exchange only routes messages with 'x-match' set to 'any'.
DThe message headers do not match the binding headers exactly; 'type' differs.
Attempts:
2 left
💡 Hint
Check the values of each header key carefully.
🔀 Workflow
expert
3:00remaining
Sequence to configure and test headers exchange routing
Arrange the steps in the correct order to configure a headers exchange and verify message routing for a queue bound with headers {"x-match": "any", "format": "json", "priority": "high"}.
A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Think about the logical order: create exchange, bind queue, publish message, verify reception.