0
0
RabbitMQdevops~20 mins

Implementing RPC client and server in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
RPC Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
RPC Server Response Behavior
Given a RabbitMQ RPC server that receives a request and replies with the square of the number sent, what will be the output on the client side if the client sends the number 5?
RabbitMQ
Client sends: 5
Server computes: 5 * 5
Server replies with the result
A10
B5
C25
DError: No response
Attempts:
2 left
💡 Hint
Think about what the server does with the number it receives.
Configuration
intermediate
1:30remaining
Correct Queue Declaration for RPC Server
Which queue declaration is correct for a RabbitMQ RPC server to receive requests and send replies properly?
Achannel.queue_declare(queue='rpc_queue', durable=True, exclusive=True)
Bchannel.queue_declare(queue='rpc_queue')
Cchannel.queue_declare(queue='rpc_queue', auto_delete=True)
Dchannel.queue_declare(queue='rpc_queue', exclusive=True, auto_delete=True)
Attempts:
2 left
💡 Hint
The queue should be shared (not exclusive) for multiple clients.
🔀 Workflow
advanced
2:00remaining
Order of Steps in RPC Client Request
What is the correct order of steps a RabbitMQ RPC client follows to send a request and receive a response?
A1,3,2,4
B3,1,2,4
C2,1,3,4
D1,2,3,4
Attempts:
2 left
💡 Hint
Think about setting up the response channel before sending the request.
Troubleshoot
advanced
1:30remaining
RPC Client Does Not Receive Response
A RabbitMQ RPC client sends a request but never receives a response. Which of the following is the most likely cause?
AThe server did not send a reply with the correct correlation ID
BThe client did not declare the request queue
CThe client used a durable queue for the callback queue
DThe server queue was declared as exclusive
Attempts:
2 left
💡 Hint
The client waits for a response with a matching correlation ID.
Best Practice
expert
2:00remaining
Best Practice for Handling Multiple RPC Requests Concurrently
What is the best practice to handle multiple concurrent RPC requests efficiently in a RabbitMQ server?
ASet the RPC queue to auto-delete after each request
BCreate a new queue for each client request
CUse a single-threaded server to process requests one by one
DUse multiple worker threads or processes consuming from the same RPC queue
Attempts:
2 left
💡 Hint
Think about scaling the server to handle many requests at once.