What is RabbitMQ's topic exchange?
Answer
The topic exchange routes messages based on wildcard pattern matching of the routing key. Routing keys are dot-separated words: order.created.us, order.shipped.eu, user.registered. Binding keys support: * matches exactly one word. # matches zero or more words. Examples: binding key order.* matches order.created and order.shipped but NOT order.item.created. Binding key order.# matches order.created, order.item.created, and order. Binding key # matches all routing keys (like fanout). Binding key *.us.* matches order.us.created but not order.created. Use cases: routing by event type and region (payment.#.eu), routing by severity and component (log.error.#), partial subscription in microservices. Topic exchange is the most flexible exchange type — it can emulate direct (no wildcards) and fanout (# binding).
Previous
What is Cassandra's eventual consistency and how does it handle conflicts?
Next
How does Cassandra's read path work?