Windows Azure ServiceBus Topic And Subscription Part-1

Introduction

In my previous post: “Overview to Service Bus Messaging” , I spoke about the types of Service Bus messaging.  One of the types of messaging which I wanted to discuss in more details is Service Bus Topic & Subscriptions.

I was wondering how to explain the concept in detail, so I thought of using a scenario to elaborate the concept and the usage.  I have selected a hypothetical weather data distribution scenario.

When I started writing the blog, I initially thought that I would be able to post the full blog content in a single post, but unfortunately it became a bit bigger than anticipated, and therefore my colleague, Brian Furlong, suggested I split into two parts.  So I have segmented my blog into two parts for better readability.

  • In part 1, I would discuss the scenario and how we would achieve the objective using Service Bus Topic and Subscriptions
  • In part 2, I would discuss how to implement the design using service bus topic and subscription.

So what is the scenario?

The scenario is; let’s assume that there is a large weather station which is monitoring and recording weather data from various monitoring units including ground station, weather satellite, etc. The large weather station in turn collates the weather data and publishes the collated weather data based on the region.  The published weather data is received by the subscribers subscribed to a region specific data. For the sake of simplicity, I have three regions in my weather data publishing scenario namely; US, EU and APAC.

There are four subscribers in this scenario with following weather data subscription requirement:

  1. Subscriber “USObserver” intends to subscribe to US region data only
  2. Subscriber “EUObserver” intends to subscribe to EU region data only
  3. Subscriber “APACObserver” intends to subscribe to APAC region data only
  4. Subscriber “GobalObserver” intends to subscribe to all weather data.

The scenario has few additional requirements for security:

  1. The subscribers should not be able to view any other data other than the subscribed data.  The rule would support the subscriber isolation scenario wherein a subscriber is allowed only to view their data and not the unsubscribed data.
  2. The subscribers should not be able to alter their rights. The rule would support the subscriber authorization scenario wherein a subscriber would be prohibited from altering the subscriber’s role and data permission.

The diagram below represents the scenario where a weather Data Publishing Service is collecting data from multiple sources for example ground monitoring, ground unit, weather satellite, etc. The collated data is then published to the subscribers.

Let’s see how we could build a highly scalable publisher subscriber messaging mechanism using windows Azure.  The solution based on Windows Azure Service Bus messaging would comprise of the following major elements:

  1. Service Bus Topic
  2. Service Bus Subscription
  3. Access Control Service

So what is our design?

Let’s have a walk through with some design aspects showing how we are going to achieve our objectives.  To achieve the desired objective we would need the following:

  1. A Publisher: For simplicity, we would create a console application which would act as a message publisher into the topic. Let’s name the application as “WeatherPublisherAgent”. The application would publish the various weather messages on to the topic. The messages are defined as “WeatherMessage” class.
  2. A Topic:  A Service Bus topic would be required and let’s name the topic as “weathertopic”.
  3. Four Subscriptions: We would require four subscriptions corresponding to each of our subscribers. Let’s name the subscriptions accordingly to the subscriber
    1.                      i.            USObservers – subscription for US tagged messages
    2.                    ii.            EUObservers – subscription for EU tagged messages
    3.                   iii.            APACObservers – subscription for APAC tagged messages
    4.                  iv.            GlobalObservers – subscription for all messages
  4. Four Subscriber Applications: For simplicity let’s have a console application for each subscriber which would be pulling the weather data from the respective subscription.
  5. Access rules:  This is one of the most important aspects dealing with security and authorization.  Let’s consider the following users with roles for the scenario:
User Role Description
publisher  Send The user would be able to send messages to a topic
usobserver Listen The user would be able to listen to messages on a topic through respective subscription. The user would only be allowed to receive messages tagged as US messages.
euobserver Listen The user would be able to listen to messages on a topic through respective subscription. The user would only be allowed to receive messages tagged as EU messages.
apacobserver Listen The user would be able to listen to messages on a topic through respective subscription. The user would only be allowed to receive messages tagged as APAC messages.
globalobserver Listen The user would be able to listen to messages on a topic through respective subscription. The user would only be allowed to receive all messages.

The diagram below represents the design overview of the solution.

My next post will elaborate on how to implement the above design.  Read it here 

For more information please email info@im-onlineservices.com or visit our website – www.im-onlineservices.com

Rahul Sur is a highly proficient and hands-on Technical Architect accomplished in designing and delivering complex and high profile IT solutions comprising middle-and-multi-tier software development across mobile, media, web and Cloud platforms using Microsoft technologies and a range of quality standards and project methodologies.

© 2012 Information Management Group Limited

About these ads

About IMGROUPonline
As one of Microsoft’s Gold Partners we are the recognised thought leaders and innovators in information management. We have one of the most experienced and highly skilled teams in the industry and have completed hundreds of successful information management projects in the private and public sectors. Our blogs will concentrate in all aspects of Business Intelligence, SharePoint, Relationship Management, Online Services, Infrastructure and Application Management.

6 Responses to Windows Azure ServiceBus Topic And Subscription Part-1

  1. Pingback: Windows Azure ServiceBus Topic And Subscription Part-2 « imgrouponline

  2. Pingback: Windows Azure

  3. Pingback: Windows Azure Community News Roundup (Edition #26) - Windows Azure Blog

  4. Pingback: Azure on Philippines

  5. Pingback: My Latest Shared Bookmarksfboiton's blog | fboiton's blog

  6. Pingback: My Daily Shared Bookmarksfboiton's blog | fboiton's blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 323 other followers

%d bloggers like this: