So you want to send Toast-Notification to the Windows Azure Service Bus Notification Hub using BizTalk Server 2013?
Well here’s the bad news
You can’t use the SB-Messaging adapter. You might wonder why? The answer is quite simple: The SB-Messaging adapter (Microsoft.BizTalk.Adapter.ServiceBus.dll) contains a reference to the Microsoft.Servicebus.dll (1.8 version) and this version does not include the Notification Hub bits and pieces. This is of course not strange at all, as the Windows Azure Service Bus Notification Hubs functionality is currently still in preview and therefore not part of the 1.8 version.
Here’s the good news
Well you might currently not be able to leverage the SB-Messaging adapter out-of-the-box functionality to send toast-notifications to windows azure service bus notification hubs; but nothing can withhold you of using the Wcf-WebHttp Adapter in combination with a custom endpoint behavior , and well in this post I will briefly show how I put it all together and was able to use BizTalk to send out Notification requests to the Windows Azure Service Bus Notification Hub.
What do you need
- A ready to use : Windows Azure Service Bus Notification Hub and an application (Windows Store or Windows Phone) which is subscribed to the Notification Hub (see tutorial here)
- Up and Running BizTalk Server 2013 Development Environment (including VS.Net 2012 update 2)
- Read & Watch
- Read the rest of this blog post.
The scenario.
A message received by BizTalk is sent to a pre-defined Windows Azure Service Bus Notification Hub called “contactcenter”; subsequently the hub will ensure that the message received is being ‘broadcasted’ to all registered applications, in my case a simple Windows Store applications. But in theory this message could have been sent to hundreds and thousands of devices as long as they would have registered themselves to receive notifications.
Please note the following: the windows store application I created and used for this scenario creates a template registration with the Windows Azure Service Bus Notification Hub. The template in question leverages the ToastImageAndText04 format (see image below). Complete Toast Template Catalog Listing can be found here
The registered template translates to the following xml
Below a mapping, showing the link between the ToastImageAndText04 template and the Schema used in the scenario by BizTalk
Recorded Demo
Below a short demo, showing the creation of a simple BizTalk Application and it’s subsequent configuration; followed by a notification request message to be send to BizTalk, which then delivers it to the Windows Azure Service Bus Notification Hub.
The behavior which glues it all together.
As I mentioned earlier; unfortunately we can not use the SB-Messaging adapter, so that’s why I had to resort to a different approach. This approach consisted of creating a custom endpoint behavior which in short performs the following logic.
<img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://blog.brauwers prix viagra pharmacie france.nl/wp-content/uploads/2013/05/image_thumb4.png" width="244" height="223">
Conclusion
Well it is fairly simple, although it requires some coding, to invoke the Windows Azure Service Bus Notification Hub using BizTalk Server and this opens up some additional ‘notification’ possibilities, however it might be a bit over-the-top to use BizTalk Server for this . Ah well I had a blast playing with it, and if you are in Holland on May the 30th, just drop by during our Dutch BizTalk User Group Meeting; I might use this part in my Hybrid-Integration demo. You can register here : http://btugnl20130530.eventbrite.nl/#
As always; please contact me if you want a copy of the custom-behavior.