Book Image

RabbitMQ Essentials

By : David Dossot
Book Image

RabbitMQ Essentials

By: David Dossot

Overview of this book

Table of Contents (17 chapters)

Adding topic messages


CCM's application allows users to organize themselves in groups by registering their topics of interest. The new message feature we want to roll out will allow a user to send a message to all users interested in a particular topic. It turns out that this feature matches a specific exchange routing rule, not surprisingly called topic! This type of exchange allows the routing of message to all the queues that have been bound with a routing key that matches the routing key of the message. So, unlike the direct exchange that routes a message to at the most one queue, the topic exchange can route it to multiple queues.

Note

The topic exchange supports strict routing key matching and also wild-card matching using * and # as respective placeholders for exactly one word and zero or more words. Words are delimited by dots, so even if routing keys are of free form, RabbitMQ will interpret dots in them as word separators. It's a good practice to structure routing keys from the most...