Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is RabbitMQ practical for RPC-esque bidirectional use during request processing?

Tags:

rabbitmq

rpc

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?

like image 308
Andrew Avatar asked Mar 12 '12 02:03

Andrew


People also ask

Is RabbitMQ bidirectional?

Producer sends messages rabbitmq, and the consumer receives messages from rabbitmq, then consumer send messages back to producer via rabbitmq.

Does RabbitMQ use RPC?

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.


2 Answers

Yes we use rabbitmq in a similar fashion in production.

See Request Reply Pattern

like image 114
LenW Avatar answered Sep 29 '22 07:09

LenW


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

like image 42
dgorissen Avatar answered Sep 29 '22 06:09

dgorissen