Grab yourself a copy of the Azure Service Bus EAI & EDI April Release. At a minimum you’ll want samples.zip and WindowsAzureServiceBusEAI-EDILabsSDK but also grab a copy of WindowsAzureServiceBusConnect while you’re there.
First ensure Windows Server AppFabric is installed. Then install the Windows Azure Service Bus EAI-EDI Labs SDK. Then install Windows Azure Service Bus Connect. Pleasantly this was a hassle free experience for me. I’m fresh from working with SQL 2012 Power View so this was a nice change.
Now for our first “Hello World” Azure Service Bus EAI solution. We’ll keep it simple. We will create a new EAI project that will have a “Bridge Application” hosted on the Azure Service Bus. That bridge application will receive a message from a client, transform the message using an Azure Service Bus map, then route the message to an Azure service bus queue.
1. From Visual Studio create new EAI Project.
2. From the Azure Labs Portal create a new namespace. This will be the container for our application on the bus.
3. Update the “service namespace” property on the “BridgeConfiguration.bcs” file.
4. From the toolbox drag a one way XML bridge and queue to the “Bridge Configuration” Design Surface. Then create a connection between the two as below.
5. Right mouse on the project and select Add New Item and create an XML schema named HelloWorld_Inbound. This will be the schema representing the XML message we will be receiving. Add another XML schema to the project called HelloWorld_Outbound.
6. Right mouse on the project and select Add New Item to add a new map to the project. Call the Map HelloWorld_Inbound_TO_HelloWorld_Outbound.
7. Define the source and destination schema for the map then draw a link between the root nodes of both. Typically this would be a complex schema with attributes and elements. For “Hello World” demo purposes we’ll keep things simple.
8. Now lets configure our bridge application and make it actually do something! Go back to the Bridge Configuration design surface. i.e. “BridgeConfiguration.bcs”. Double click on the XmlOneWayBridge1 to view the bridge configuration. It should look something like the below.
9. Configure the message type that will be received by the bridge application. This is HelloWorld_Inbound.xsd.
10. Configure the bridge to execute the map by selecting the maps collection on the transform shape as below.
11. Go back to your bridge configuration surface and select the connector between the XmlOneWayBridge1 shape and Queue1 shape. Select the “Filter Condition” property and select “Match All” as below. This basically means all messages will be routed from the bridge to the queue.
12. Go back to the Azure Labs Portal and create a new queue called queue1 under the HelloWorldServices namespace we created in step 2.
13. We’re done! How easy was that. Build your EAI project and then deploy. You’ll come up against the below screen. The “Shared Secret” is the value of the “Default Key” property on the namespace you created in step 2. Paste it, hit okay and our first bridge application will be deployed to the Azure Service Bus.
Now how do we test. Remember samples.zip that you should have downloaded. Extract it and find the MessageSender solution under the Tools folder. Compile it then run it with the below parameters. The blacked out parameter is again the “Default Key” for the namespace created in step 2. After this check the queue depth property on the queue created in step 12.