BizTalk Server 2013 Beta introduces the new SB-Messaging adapter to send and receive message from the Windows Azure Service Bus entities like Queues, Topics, and Relays. The topics on MSDN provide instructions on how to configure an SB-Messaging receive location and a send port to receive and send messages from the Service Bus but there is no information provided on how to do it with the ESB Toolkit. I really like the ESB Toolkit concept but it’s not quite finished so if you want to sent a message to a Service Bus Queue in Windows Azure it will not work out of the box.
There is no SB-Messaging Adapter Provider in the ESB Toolkit so to make it work you will have to create a Custom SB-Messaging Adapter Provider. Furthermore is also a Custom Routing Service needed. The Routing Service of the ESB Toolkit set’s all the necessary properties on the Dynamic Send Port but the Authentication Properties and the Brokered Message Properties from the SB-Messaging adapter have to be set on the message as context properties.
<adapterProvider name="SB-Messaging" type="itHero.ESB.Adapter.SBMessaging.AdapterProvider,
itHero.ESB.Adapter.SBMessaging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cdb4e8bc8e6104aa" moniker="SBMessaging" />
<?xml version="1.0" encoding="utf-8" ?> <adapterPropertyManifest adapterName="SB-Messaging"> <aliases> <alias name="globalPropertySchemas" value="Microsoft.BizTalk.GlobalPropertySchemas,
Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </aliases> <properties> <property name="IssuerName" type="WCF.IssuerName" assembly="globalPropertySchemas" /> <property name="IssuerSecret" type="WCF.IssuerSecret" assembly="globalPropertySchemas" /> <property name="StsUri" type="WCF.StsUri" assembly="globalPropertySchemas" /> <property name="Label" type="SBMessaging.Label" assembly="globalPropertySchemas" /> </properties> </adapterPropertyManifest>
//Set WCF-properties msg.Context.Write("IssuerName", http://schemas.microsoft.com/BizTalk/2006/01/Adapters/WCF-properties, endpointConfigItems["IssuerName"]); msg.Context.Write("IssuerSecret", http://schemas.microsoft.com/BizTalk/2006/01/Adapters/WCF-properties, endpointConfigItems["IssuerSecret"]); msg.Context.Write("StsUri", http://schemas.microsoft.com/BizTalk/2006/01/Adapters/WCF-properties, endpointConfigItems["StsUri"]); //Set BrokeredMessage-properties msg.Context.Write("Label", http://schemas.microsoft.com/BizTalk/2012/Adapter/BrokeredMessage-properties, endpointConfigItems["Label"]);
<itineraryService id="10000" name="itHero.ESB.Itinerary.Services.ServiceBusRouting" type="itHero.ESB.Itinerary.Services.ServiceBusService, itHero.ESB.Itinerary.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=191980cbfe160b14" scope="Messaging" stage="AllReceive"/>
It is unfortunate that the SB-Messaging adapter provider is not available out of the box in the ESB Toolkit. You can easily expand the ESB Toolkit but it’s not extensively documented so it took me quite some time to create the Custom Messaging Service and the SB-Messaging Adapter Provider to set the necessary properties,.
You can download the Custom Messaging Service and the SB-Messaging Adapter Provider with the source code here: http://code.msdn.microsoft.com/Using-the-SB-Messaging-38230f9e