RabbitMQ architecture for communication between multiple nodes

39 views
Skip to first unread message

Ali Uz

unread,
Apr 28, 2015, 3:52:19 PM4/28/15
to rabbitm...@googlegroups.com
Hi,

I'm fairly new to RabbitMQ and Message queues in general so I wanted to run it by the group to see how I can improve my messaging architecture. 

I currently have an API which you can think of as an entry point, the API will forward the data to a first node, which in turn will process it and also send it to a second node. I thought of using RabbitMQ for the passing around of data and so I setup a server on EC2 and configured a single exchange which is bound to two queues. The API publishes to the exchange which is on the server, the message is consumed then put on to another queue to which the second node subscribes to and consumes the message.

Now that I wrote it out and look at it, I think I may be overcomplicating things, the general design I was going for was API -> Queue1 -> Node 1 -> Queue2 -> Node2. Can I accomplish this with a single queue? Do I even need an exchange at all? I would really appreciate some guidance.

Thanks!


Michael Klishin

unread,
Apr 28, 2015, 4:03:40 PM4/28/15
to rabbitm...@googlegroups.com, Ali Uz
 On 28 April 2015 at 22:52:20, Ali Uz (ali...@gmail.com) wrote:
> Now that I wrote it out and look at it, I think I may be overcomplicating
> things, the general design I was going for was API -> Queue1 ->
> Node 1 -> Queue2 -> Node2. Can I accomplish this with a single queue?
> Do I even need an exchange at all? I would really appreciate some
> guidance.

Ali,

The "node" above is a single application, not a RabbitMQ node, correct?

If so, you can use the default exchange to publish "directly" to a queue. It sounds like you want 2 queues.
There is no way to selectively consume message with RabbitMQ: distribution happens at the routing stage between queues.

Tutorials 1 and 2 are a good starting point:
http://www.rabbitmq.com/getstarted.html

and in case protocol concepts or terminology are not clear, there is
http://www.rabbitmq.com/tutorials/amqp-concepts.html
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Ali Uz

unread,
Apr 28, 2015, 4:22:18 PM4/28/15
to rabbitm...@googlegroups.com, ali...@gmail.com
Hey Michael,

Indeed the node(s) are just applications passing data forward, the rabbitMQ service is on a separate server and is running the exchange. I think I get what you mean when you say you cannot selectively consume messages, so I think I am on the right track by implementing 2 queues.  
Reply all
Reply to author
Forward
0 new messages