Determining the receive port or location for a message in BizTalk 2006
I need to know which receive port or location a given message was received through by either examining the name of the receive port/location, or populating a context property with either the name, or with some static string that I can define on each port/location
I will use this information in a custom disassembler to do some work on the message, but i need to know which port the message so that I know what kind of work I need to do to the message. I'm pretty confident I know how to开发者_StackOverflow read context properties in a custom component like this, but I just can't figure out how to populate it earlier on. And I can't figure out if the port a message came in on is noted anywhere on the message itself.
There is a nice list of the available context properties on Abhilash's blog.
What you want is the ReceivePortName, so in your pipeline you would want something like:
public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
{
IBaseMessageContext context = pInMsg.Context;
string portName = context.Read("ReceivePortName", "http://schemas.microsoft.com/BizTalk/2003/system-properties").ToString();
}
精彩评论