Service Bus in Azure
Martin Heller posted a nice article about the Azure Services Platform CTP's.
Martin did a good job talking about what pulls the platform together... it's a set of loosely coupled services, that offer standard (REST / SOAP) API's that are easy to consume from any platform. You can use all of these services separately (e.g. use the SQL Data Services from an app hosted on GoDaddy), but the idea is that Microsoft gives you a single, cohesive platform to build cloud-based or cloud-aware applications, including being able to host web pages and (WCF) web servcies, being able to authorize access to those services, being able to exchange messages between those services and any other applications...
Martin characterized .NET Services in the following way:
.Net Services include the .Net Access Control Service, which controls access to Web resources using security tokens; the .Net Service Bus, which is a discoverable registry of Web end points; and the .Net Workflow Service, which is a sequential workflow controller.
I think the descriptions for Access Control and Workflow are good, but the Service Bus bears further elaboration.
The way I would describe the Service Bus is as a firewall-friendly, Internet-scale pub-sub messaging system. What you do with the Service Bus is quite simple. Just like in any Enterprise Service Bus, you have subscribers or receivers that listen to messages coming on a particular address, and you have publishers or senders that can send messages to that address. You can have one or more subcribers - one subscriber is just a degenerate case of the more general "one-to-many" pattern.
So what is new and different about this kind of Service Bus? It allows you to send and receive messages across any network topology, and facilitates security across trust domains. For example, I can have a receiver sitting behind a corporate firewall, and the sender be a .NET Workflow Service (using the CloudServiceBusSend activity). The Service Bus automatically ensures delivery of the message.
The nice thing is that the sender or receiver doesn't have to be a .NET application - it can be a Java app or a Ruby app. We have SDK's for those posted on our portal.
So we have this Service Bus in the cloud, but in order to make it usable by .NET developers, we've added some .NET classes that integrate it with WCF, the .NET communications framework. That integration comes in the form of a Service Bus binding, which is a peer to the existing bindings (basicHttpBinding, webHttpBinding, wsHttpBinding, etc).
The simplest thing you can do with that binding is to put your service on the Internet. By adding a Service Bus endpoint to your list of endpoints, you are effectively giving your service an Internet-accessible address, even if your service is sitting behind a firewall. That's because Service Bus has a relay built-in.
Building a multicast system is just as easy. A listener is simply a service that uses the Service Bus binding to listen on a particular address, and there can be more than one. A sender is simply a client-side proxy that sends a WCF message to that address. It's really as simple as that.
What is that address, you may ask? Very simple. Your .NET Services account has a name. Martin's was evidently called "iw_mh_azure". Martin effectively owns sb://servicebus.windows.net/iw_mh_azure and everything under it. He can pick any address he wants as long as it's under that root in the service bus namespace. That's why the accounts have to be unique
So you may ask, what is Martin talking about when he mentions this "discoverable registry of Web end points"?
It turns out that Service Bus has one additional cool feature, which is that you can configure a service that uses the Service Bus binding to automatically add itself to an AtomPub Service Document that we have at the root of your portion of the Service Bus namespace. So Martin could create a service called HelloWorld and give it the address sb://servicebus.windows.net/iw_mh_azure/HelloWorld, and if he navigated to http://servicebus.windows.net/iw_mh_azure, he'd see an AtomPub feed with an entry for that service. And if that service supported GET and returned an AtomPub feed, Martin (or any of his users) could navigate that AtomPub document. While cool, I don't think of this feature as the most important one, hence this blog post 
That's about it... if this all sounds interesting, go to www.azure.com and follow the sign-up instructions. We make you sign up on Microsoft Connect, but we've basically caught up with the waiting list and have provisioned almost everyone that's signed up with a .NET Services / SQL Data Services account, so your wait shouldn't be long...
Happy coding  Indigo AKA WCF | Web Services/XML | .NET Services
Friday, December 19, 2008 1:37:02 AM (GMT Standard Time, UTC+00:00)
|