Right now I'm using rabbitMQ to send data between two programs - 1 queue, 1 channel, 1 exchange. I'm going to extend it to be multithreaded and I want to declare another queue on the second thread.
As you figured out, the channel is the communication end point used to reach a rabbitMQ object.
There are so far 2 kinds of objects:
As a simple analogy, queues are the pipes in which messages get accumulated, and exchanges are the T shaped, cross shaped and other types of connectors between pipes.
Perhaps it works better to compare it with a physical network, where queues would be like cables, and exchanges like switches or smart hubs, for which different distribution strategies can be chosen.
So basically, what you need to do is simply create a new queue from the new consumer thread, have it connect to the exchange object (for which you should have a name), and let the producer thread send its messages to the exchange object exclusively. Any new thread may follow the same protocol.
The last important point is to pick the correct distribution method for the exchange object, round-robin, fanout, etc. depending on how you wish your consumers to receive messages.
Take a look at our introduction to AMQP concepts
http://www.rabbitmq.com/tutorials/amqp-concepts.html
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