BizTalk Parallel Convoy

This blog is to explain about BizTalk Parallel Convoy.

What is Parallel Convoy?

Parallel Convoy is one type of BizTalk design pattern to achieve particular type of requirements. This can be defined as “A parallel convoy enables multiple single messages to join together to achieve a required result. The set of related messages can arrive in any order, but BizTalk Server must receive all of them before starting the process”

Sample Scenario for Parallel Convoy:

My Orchestration has to produce a customer address which is having Billing and Shipping details.

My Orchestration has to receive the Billing address details from Source A and Shipping Address details from Source B. Once both messages are received, then only my orchestration has to proceed further to produce full customer address. If any one of the addresses are not received, my orchestration has to wait till other message received.

This scenario can be achieved through parallel convoy design pattern in BizTalk.

  1. We need to create 3 schemas, Correlation type and correlation set.
  • Schema1 is for Billing Address

1.png

  • Schemas 2 is for Shipping Address

2.png

  • Schema 3 is for Full Customer Address

3.png

 

2. Insert “ParallelActions” shape into the BizTalk orchestration editor.

3. Drag and drop two receive shapes inside the parallel convoy shape like below

4.png

4. Create a message for Billing Address and assign to the shape “Receive_1”

5. Create a message for Shipping Address and assign to the shape “Receive_2”

6. Set “Initializing Correlation Sets” property for both receive shapes with the correlation set created in above steps.

Please note that both receive shapes are having “Initializing Correlation Sets”.

If Receive_1 shape receives the message first, then other receive shape will act as follow correlation on CustId.

If Receive_2 shape receives the message first, then other receive shape will act as follow correlation on CustId.

Once both messages are received then only It will proceed further to apply a map to produce full customer address.

7. Create a map to produce full customer address

Input messages: Billing and Shipping Addresses

5.png

Output Messages: Customer Address

6.png

 

Click on “OK”

7.png

8. Send the final message (Full Customer Address) to the destination system based on your requirement.

Here is the sample Orchestration view for Parallel Convoy demo.

8.png

We will talk about sequential convoy in upcoming blogs.

 

 

 

 

 

 

 

Advertisements

BizTalk Correlations

This blog is to explain about BizTalk Correlations.

What is Correlation?

Correlations can be defined as binding incoming messages with the appropriate instance of an orchestration.

Sample Scenario for Correlations:

My Orchestration has to send a request message to a Message Queue, let’s say it is “Input Queue”. Some other process takes the input message from “Input Queue” and after processing, output will be sent to another Queue, let’s say it is “Output Queue”.

Now Orchestration has to receive the message from Output Queue.

Also, my orchestration has to make sure that, it is consuming the output message of the of the correct instance.

How to Implement Correlations:

If we need to implement correlations, both input and output messages should have a common field element. For Example

Input Message:

1.png

Output Message:

2.png

Also, common element (CustId) should be property promoted.

Go to Orchestration View–>Types–>right click on Correlation Types–>Select New Correlation Type–>Correlation Properties windows appears with two panels.

Left Side Panel is “Available Properties” and the right-side panel is “Properties to correlate on:”

We need to select our property promoted field from left side panel and click on “ADD”, then field will be added to right-side panel. Using this common field, we will correlate request and response messages in the orchestration.

3.png

So far, we have created a Correlation Type.

Now we need to create a Correlation Set, which will be used in Orchestration Receive and Send shape properties.

Go to Orchestration View–>right click on Correlation Sets–>Select New Correlation Set->One Correlation set will be created.

Correlation Set properties–>you need to select correlation type which we have created above.

4.png

Now we are ready with correlation Sets.

Orchestration Properties:

In orchestration, if we want to send the message out, it will be through send shape. In send shape properties, we need to provide the “Initializing Correlation Set” property and select the correlation set which you have created in above steps.

5.png

Similarly, we need to provide “Follow Correlation Set” property in Receive shape which will be used to receive the response message. “Activate” property should be false in this second receive shape of the orchestration.

6.png

When you initialize the correlation set, one subscription id will be created for your instance in the message box and when you follow the same correlation set, using the subscription id, correct message will be received for that instance. This mechanism will be taken care by the BizTalk engine internally.

Here is the sample Orchestration view for Correlations demo.

7.png

Using these correlations, we will design Convoys (Sequential & Parallel) in upcoming blogs.