I've read the documentation and I'm pretty sure I understand the concept of the different components present in an AMQP based message queue. However, I am having a hard time mapping that to an actual service oriented implementation. Could someone give a sort of "textbook" example of two services communicating through the pathway:
Producer -> Exchange -> Binding -> Queue -> Consumer
Specifically, I'm curious about when to reuse a queue or declare a new one. The "hello world" textbook naming conventions used in most systems for things like names of exchanges and such would be great as this has me quite flustered!
Queues are buckets of work that are waiting to be completed. If you only have 1 unit of work to be done, then you only need 1 queue.
The reason to have more than 1 queue on an exchange is that you need to do different work on the same data. For example: lets say you get an incoming message and you want to:
You could accomplish this by creating a single FANOUT exchange with 2 queues. You then have 2 buckets of work that can be completed by two different consumers. The advantage of separating these is:
There are lots more ways you could use rabbit. Hopefully this was helpful.
Checkout the RabbitMQ getting started guide.