BizTalk Migration To Azure (Routing)
In the previous article I wrote about the Message box and a Biztalk Message. Another thing we need to address is the routing. In BizTalk the routing is done based on context properties or an Itinerary (if you use the ESB components from BizTalk). Once a message is Received the routing will make sure the message is processed until it reaches the destination.
I will keep things simple and let’s say that routing consists of a list routing items. A single routing item will basically consist of two things:
In the previous post I Talked about an unzip Example. But what should be unzipped, The payload, Or an attachment? That’s what the parameters are for, to give instructions to the routing Endpoint. But there is nothing in place to perform the routing. So that is why we have to create the OnRamp router.
?
The OnRamp Router
The OnRamp is a Function app that listens to the OnRamp queue. Whenever a message is put on the OnRamp queue, it will trigger the OnRamp function. Below is the functionality of the onramp router:
?
Try
Delete the message from the queue (no dead lettering)
Deserialize the claim to get an instance of the class
Get the first Routing Item from the Routing Slip
Read the queue
Write the message to the queue of the Endpoint
Catch
???????????????Set error information (more on this later)
???????????????Persist Claim to Blob Storage
The Endpoint
A routing Endpoint is Basically a Service Bus triggered Function app. The function app can only succeed or fail, there is no maybe here. It will serve as the entry point for whatever you want to do. In my example I want to unzip the attachment. So let’s see what the steps are to perform the unzip operation:
?
Try
领英推荐
Catch
?
This is enough to get a message flowing in Azure. To really get it going you will have to perform the following steps when a message is received.
Voila, there is, ?we have a ?message routing solution. With this mechanism it is possible to create workflows. You just have to make sure that routing is added to a message (Itinerary) and send it to the OnRamp router.
One thing to keep in mind is to keep the Function Apps simple and do one only 1 thing. You could compare each Function App with a BizTalk Pipeline Component. You can chain as many as you like. This will promote reuse and will shorten development time of integrations.
?
Some of the Function apps that I have created are:
Unzip
Xls2Csv
Csv2Xml
Payload2Blob
XpathPromoter
Digital Signature
?
With these components (Claim, OnrampRouter, RoutingSlip) we have the most important parts of a solid integration solution. We have a versioned claim so we can handle really large messages, we have a routing mechanism to get the flow going. But what's missing is the link to the message Box.
I started with the messagebox in the first post but haven’t mentioned it until now. In the next part I will dive into what we have now?and how we can get messagebox functionality as well.