This article will dive into the new feature of pulling messages from Service Bus Queue. When a developer designs and build a bridge he/she can now choose two new sources i.e. Service Bus Queues and Topics. A Bridge with Azure BizTalk Services is a workflow that processes a message pulled from a source and delivered to a destination (see picture below).
Figure 1 - BizTalk Services Bridge concepts.
The ability to pull messages from Service Bus queues and topics increases the durability of a bridge solution. You can leverage the pub-sub mechanism of the topics and subscriptions. It is even possible to have multiple bridges pulling messages from different subscriptions and have them send to multiple destinations. A single bridge will not enable you to do that.
Another benefit is that you as a developer will have more input channels for the bridge besides FTP, and HTTP (REST). Indirectly through the Service Bus Queues you could have support for AMQP.
To explore the new capability of pulling message from the Service Bus we will explore the following scenario. A payroll company wants to offer a service in Azure BizTalk Services for organizations to send their payroll data for pay rolling. Organizations that like to outsource their pay rolling can connect to this service in Azure. Basically the organizations can send their payroll data to the service in any kind of format and structure they want. The payroll company will provide a bridge to provide connectivity to the source the organization pushes its data to. This can be FTP(S), HTTP or the Service Bus Queue or Topic (subscription). The data will be picked up from the source and processed to one unified format to be routed to a LOB system or database for a later pay roll run that the payroll company will do. Below you will find a diagram detailing the scenario.
Figure 2 - Diagram of the payroll scenario.
The solution will be a bridge for an organization that requires to push out its payroll data to the payroll company. In this case the data is pushed to a Service Bus Queue and the Bridge will pull the data from the queue, transform it to a format that enables a table operation in SQL Server on premise. To build this solution the following parts need to build, configured and/or created:
Installed Templates
Click BizTalk Services, then click BizTalk Service.
Name
Specify a name.
Location
Set this to a location on your computer.
Create directory for solution
Select this if you want this solution to have a separate folder in Windows Explorer.
Table 1 - BizTalk Service Project specifications.
Figure 3 - Credentials for accessing the LOB Types.
Figure 4 - LOB Target configuration Welcome screen/tab.
Figure 5 - Specifying the settings for connecting to SQL Server database.
Figure 6 - Operations tab for specification of operations on the LOB Target (SQL Server Object).
Figure 7 - Specify the run time security settings for access to LOB Target (SQL Server).
Figure 8 - LOB Relay settings.
Service Bus Namespace
Specify the Service Bus namespace on which the LOB relay endpoint is created.
Service Bus Issuer Name
Specify the issuer name for the Service Bus namespace
Service Bus Issuer Secret
Specify the issuer secret for the Service Bus namespace
LOB Relay Path
Enter a name for the relay.
LOB Target Sub-path
Enter a sub-path to make this target unique.
Target runtime URL
This read-only property displays the URL where the relay is deployed on Service Bus. This is the path where you could send a message to be inserted into the on-premises SQL Server. In the payroll scenario, this is where the bridge routes the message.
Table 2 - Specifications for LOB Relay target.
Figure 9 - Summary tab LOB Target.
Figure 10 - LOB Target part as an application in IIS.
When a LOB Target is created you can generate the schema(s) for specified operation(s). The following steps describe how to generate the schema for the insert operation:
Figure 11 - Schema generation specifications and credentials.
Figure 12 - LOB Schemas in BizTalk Service Project.
In BizTalk Service project you can create the schema for the incoming request message containing the payroll data. The data is delivered per employee. The schema can be created as visualized by the screenshot below.
Figure 13 - Payroll data schema.
The following steps show how to transform the incoming request message (source) to a request message for LOB Target (destination):
Figure 14 - Mapping between payroll schema (incoming message) and SQL table operation schema (Insert).
Figure 15 - Specify the settings for Service Bus Queue source.
Figure 17 - Specifying the Route Action to the destination.
Figure 18 - Message flow for payroll data.
Figure 19 - Specify the settings for deployment to the BizTalk Service.
Figure 20 - Send message to the Service Bus Queue payroll using Microsoft Azure Service Bus Explorer.
Figure 21 - Log of the sent message to the Service Bus Queue payroll.
Figure 22 - Payroll data in SQL Server table Employee.