Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Message routing with Windows Azure Service Bus

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.

like image 661
Kenn Avatar asked Dec 06 '12 22:12

Kenn


People also ask

Does Azure Service Bus store messages?

What is an Azure Service Bus queue? A Service Bus queue is an entity in which messages are stored. Queues are useful when you have multiple applications, or multiple parts of a distributed application that need to communicate with each other.

How do I send a message to Azure Service Bus Explorer?

To send a message to a Queue or a Topic, right click on the queue or topic name on the Service Bus Explorer navigation pane and select “Send Messages”.

What is Azure messaging in Service Bus?

Azure Service Bus offers three types of communication mechanisms; queues, topics and, relays. Queues and Topics, facilitate one-directional communication. Messages will be stored until they are consumed. Each message in Queue is received by a single recipient.


1 Answers

Windows Azure Service Bus Topics and Subscriptions allow you to do exactly the same:

enter image description here

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

like image 77
Sandrino Di Mattia Avatar answered Nov 04 '22 00:11

Sandrino Di Mattia