Introduction

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.

 

Description

In the 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:

 

C#
Edit|Remove
// Lookup itinerary via resolver 
ResolverDictionary dictionary = ResolverMgr.Resolve(config); 
 
object interchangeID = msg.GetPropertyValue(typeof(BTS.InterchangeID)); 
 
// Serialize itinerary 
StringReader reader = new StringReader(dictionary.Item("Resolver.Itinerary")); 
XmlSerializer ser = new XmlSerializer(typeof(Itinerary), "http://schemas.microsoft.biztalk.practices.esb.com/itinerary"); 
 
//Create Itinerary object 
Itinerary it = (Itinerary)ser.Deserialize(reader); 
 
//Get the first service from itinerary 
ItineraryServicesService service = it.Services[0].Service;

More Information

For more information on the sample see:
http://www.ithero.nl/post/2013/02/09/Creating-a-MessageBox-On-Ramp-for-the-ESB-Toolkit-in-BizTalk-2013.aspx