Super simple question, I couldn't find a concrete answer out there.
Is RabbitMQ suitable for RPC-like operations when processing HTTP requests?
I'm interested in firing off a message when a user HTTP request is received, waiting for the response from a backend server, and then sending the response to the client.
Is that a common use scenario? Are people doing it with success? Any pitfalls? Any examples or common design patterns?
Producer sends messages rabbitmq, and the consumer receives messages from rabbitmq, then consumer send messages back to producer via rabbitmq.
In general doing RPC over RabbitMQ is easy. A client sends a request message and a server replies with a response message. In order to receive a response the client needs to send a 'callback' queue address with the request.
Yes we use rabbitmq in a similar fashion in production.
See Request Reply Pattern
This has worked for me, I do suggest you look at the Web messaging extentions/tools though:
http://www.rabbitmq.com/devtools.html#web-messaging
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With