Message routing with Windows Azure Service Bus
azure, azureservicebus, message-queue
Solution
Windows Azure Service Bus Topics and Subscriptions allow you to do exactly the same:
Let's compare the image to your example:
- The direct exchange X would be the DataCollection `Topic` in the image.
- Q1 would be the Dashboard `Subscription` (with a `Filter` set to Redmond)
- Q2 would be the Inventory `Subscription` (without `Filter`, meaning it would receive all messages).
It's actually very simple. Your clients send a message to the Topic (similar to a queue) and can add some metadata to this message (this can be used as a `binding key`). Now you don't read messages from the Topic itself, the Topic will forward the messages to all Subscriptions. To implement message routing you would simply set a filter on one or more Subscriptions using a syntax similar to SQL.
Python tutorial: How to Use Service Bus Topics/Subscriptions
Problem
I'm a few hours into understanding the Azure Service Bus architecture. I'm wondering specifically if this queueing technology can be used to support message routing - something similar to RabbitMQ's routing abilities. http://www.rabbitmq.com/tutorials/tutorial-four-python.html We will use a direct exchange instead. The routing algorithm behind a direct exchange is simple - a message goes to the queues whose binding key exactly matches the routing key of the message. In this setup, we can see the direct exchange X with two queues bound to it. The first queue is bound with binding key orange, and the second has two bindings, one with binding key black and the other one with green. In such a setup a message published to the exchange with a routing key orange will be routed to queue Q1. Messages with a routing key of black or green will go to Q2. All other messages will be discarded. Looking for somebody with deep understanding of the Service Bus architecture to recommend the best vector for implement this sort of queue.