4.9.2. Topic Exchange

A Topic Exchange routes messages based on the routing key (subject) of the message and the binding key of the subscription, just as a direct exchange does. The difference is that a topic exchange supports the use of wildcards in binding keys, allowing you to implement flexible routing schemas.
A Topic Exchange routes messages to queues where there is an match between the binding key of the queue and the routing key of the message. A binding key used to bind a queue to a Topic Exchange supports wild card matching, enabling developers to implement flexible routing schemes.

Figure 4.3. Topic Exchange

Wildcard matching and Topic Exchanges

In the binding key, # matches any number of period-separated terms, and * matches a single term.

So a binding key of #.news will match messages with subjects such as usa.news and germany.europe.news, while a binding key of *.news will match messages with the subject usa.news, but not germany.europe.news.