0
0
RabbitMQdevops~20 mins

Correlation ID for matching replies in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Correlation ID Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Purpose of Correlation ID in RabbitMQ

What is the main purpose of using a Correlation ID in RabbitMQ messaging?

ATo uniquely identify and match a reply message to its original request message
BTo specify the queue where the message should be delivered
CTo encrypt the message content for security
DTo set the message priority for delivery order
Attempts:
2 left
💡 Hint

Think about how a client knows which reply belongs to which request.

💻 Command Output
intermediate
1:30remaining
Output of a RabbitMQ message with Correlation ID

Given a message published with the following properties:

properties = {"correlation_id": "abc123", "reply_to": "response_queue"}

What will be the value of correlation_id in the received message properties?

A"abc123"
B"response_queue"
Cnull
D"correlation_id"
Attempts:
2 left
💡 Hint

The correlation_id is set explicitly in the message properties.

🔀 Workflow
advanced
2:30remaining
Correct workflow to handle RPC with Correlation ID

Which of the following workflows correctly uses the Correlation ID to handle RPC (Remote Procedure Call) replies in RabbitMQ?

AClient sends request with Correlation ID; server sends reply without Correlation ID; client matches replies by timestamp.
BClient sends request without Correlation ID; server generates Correlation ID and sends reply; client listens on default queue without matching Correlation ID.
CClient sends request with a unique Correlation ID and reply_to queue; server processes and sends reply with same Correlation ID to reply_to queue; client listens on reply_to queue and matches replies by Correlation ID.
DClient sends request with Correlation ID; server ignores Correlation ID and sends reply to a fixed queue; client matches replies by message content only.
Attempts:
2 left
💡 Hint

Think about how the client knows which reply belongs to which request.

Troubleshoot
advanced
2:00remaining
Troubleshooting missing replies in RPC with Correlation ID

A client sends RPC requests with unique Correlation IDs and a reply_to queue. However, the client never receives replies. Which of the following is the most likely cause?

AThe server is sending replies to the default exchange instead of the reply_to queue.
BThe client is listening on the wrong queue, not the reply_to queue specified.
CThe server is not setting the Correlation ID in the reply message properties.
DThe client is not generating unique Correlation IDs for each request.
Attempts:
2 left
💡 Hint

Check where the client is listening for replies.

Best Practice
expert
2:30remaining
Best practice for generating Correlation IDs in RabbitMQ RPC

Which of the following is the best practice for generating Correlation IDs for RPC requests in RabbitMQ to ensure reliable reply matching?

AUse the client's IP address as the Correlation ID.
BUse a simple incrementing integer starting from 1 for each request.
CUse the current timestamp in seconds as the Correlation ID.
DUse a UUID (Universally Unique Identifier) for each request's Correlation ID.
Attempts:
2 left
💡 Hint

Think about uniqueness and collision risk.