In an environment where Microsoft BizTalk ESB Toolkit is deployed, a BizTalk receive location responsible for receiving ESB-destined messages is referred to as an "on-ramp." In the receive location you have to use one of the pipelines provided as part of the toolkit, and then correctly configure the components of that pipeline to determine the itinerary and link it to the message. So you can use almost any location outside BizTalk as an on-ramp but what if you want to pick up a message from the MessageBox database and use an itinerary to process that message? You can’t use pipeline components once a message is picked up by BizTalk and is already in the MessageBox. Therefore you have to create custom code that must be invoked in an orchestration to perform the steps that are normally made inside the pipeline. The objects that are used inside the ESB Toolkit are not described on MSDN so Reflector is you best friend to figure out which objects have to be used and how to invoke them.
In the following example I’m going to process a sales order message in BizTalk with an orchestration. In the orchestration is an event message created that is sent to the MessageBox and picked up by an itinerary. (The same itinerary can be used to process multiple event types.)
The following steps are necessary to make it work:
Once the schemas, map and orchestration is deployed to BizTalk, the itinerary is deployed to the Itinerary Store database and de custom component is placed in the GAC, the solution is ready to be tested. Create a simple Receive Port in the Administration Console and drop a SalesOrder message in it. I’ve used the Trace class in System.Diagnostics to trace the steps but you can also use another component for it like ETW tracing.
It took me quite some time to figure out which objects are necessary for the ESB Toolkit and how they work, but as always, once that is done, it is not very difficult to create the code and get it working!
You can download the Solution with the .XSD schemas, Map, Orchestration, Custom Component and Itinerary here:
Note The sample is in BizTalk 2013 but this is also possible in BizTalk 2010