Service Bus support in azure npm 0.5.2

This just in:

Andre (my team) just published the latest version of our node azure module – 0.5.2:

Primary changes:

  • Azure Service Bus support!
  • Node.exe version requirement lowered to raise compatibility. This should enable using our SDK on Heroku and should make Juan Pablo Garcia and Matias pretty happy.
  • Multiple Bugfixes
  • Storage Services UT run against a mock server which should make tests run much faster. (just “npm test”)

Service Bus

The Service Bus provides secure messaging and relay capabilities that enable building distributed and loosely-coupled applications in the cloud, as well hybrid application across both private and public clouds. It supports multiple messaging protocols and patterns and handles delivery assurance, reliable messaging and scale for your applications. The Service Bus is a managed service that is operated by Microsoft and has a 99.9% monthly SLA. more here

In our latest update, you can now access Service Bus right from within your node.js applications! Below are snippets indicating usage.

Here’s an example of using the apis to create a queue

1 2 3 4 5 6
var serviceBusService = azure.createServiceBusService();
serviceBusService.createQueueIfNotExists('taskqueue', function(error, created){
if(!created){
// Queue exists
}
});
view raw gistfile1.js hosted with ❤ by GitHub

Here is how you send a message with a specific topic

1 2 3 4 5 6
var serviceBusService = azure.createServiceBusService();
serviceBusService.sendTopicMessage('taskdiscussion', 'Hello world!', function(error){
if(!error){
// Message sent
}
});
view raw gistfile1.js hosted with ❤ by GitHub

And finally this is how you poll the queue for a message.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
var serviceBusService = azure.createServiceBusService(),
topic = 'taskdiscussion',
subscription = 'client1';
 
serviceBusService.createSubscription(topic, subscription, function(error1){
if(!error1){
// Subscription created
 
serviceBusService.receiveSubscriptionMessage(topic, subscription, function(error2, serverMessage){
if(!error2){
// Process message
}
});
}
});
view raw gistfile1.js hosted with ❤ by GitHub

Be sure to also check out our unit tests for more samples. We’ll also have content on the dev portal for Service Bus very shortly.

We would like to thank the community and our advisors for the feedback and suggestions so far, which we have tried to accommodate as much possible for this release.

We’d also like to thank the community contributors that participated (Einar in particular a big thanks) in this release. We are looking forward to more contributions in the future :)

As to the road ahead, well here’s a little teaser…..

  • Service runtime –> Allows you to obtain and control the information on the actual machine your app is running in.
  • Service management and deployment –> Manage and deploy services on any platform using node cli tools.

Yes, we are still having lots of fun!

This entry was posted in azure, node, node.js. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://www.dermatologi.no/ Hudlege

    This is so informative article. Thank you so much for sharing with us.

  • http://twitter.com/rickggaribay Rick G. Garibay

    Super dooper. Nice work!