Queuing with RabbitMQ
Queuing can improve the scalability of your service, just as it can in the physical world. When too many clients all need to call a service at once, we can use a queue to smooth out the load.
There are many queuing systems available for all the major development platforms. One of the most popular is RabbitMQ. It implements the Advanced Message Queuing Protocol (AMQP).
With AMQP, messages are published to exchanges, which then distribute message copies to queues using rules named bindings. Then a broker can deliver the messages to consumers subscribed to a queue (sometimes called a topic) or a consumer can read from a queue when they want.
Since networks and systems often fail, AMQP uses message acknowledgments to tell the broker when a consumer has successfully processed a message, and only then does the broker remove the message from the queue.
RabbitMQ supports four types of exchange:
- Direct: A direct exchange delivers messages based...