Dynamic port binding
You won't be dealing with the predefined pipeline anymore. It will be a
custom pipeline that contains all the existing pipeline compnents in
BTAHL72X plus your custom pipeline components at the end.
There is a sample custom pipeline component in
SDK\Sample\Pipeline\CustomComponent\FixMsg. Depending where you get your
dynamic query string data, it could be very simple or a little bit more
complex.
If you already have the value (from design time or hard coded), all you
need to do is just update the OutboundTransportLocation (OTL) in the
Excute() call and that will be it.
OR
If the query string is being extracted (prompted) from say a XML data file,
then you have two options. Because all of the default pipeline components
process the data in streaming fashion so that large message will not occupy
large memory footprint. With that design, you will only know all prompted
properties once the stream has been complete pulled. There are two ways you
can go about doing this:
1. Pull the stream of inmsg completely in your component, then you will be
able to access all of the prompted properties on the inmsg. Then you can
set your OTL context property. Note: you will need to wrap the stream in
your own seekable stream so that down level can access the data in your
outmsg. Also if you will be dealing with large messages with high load, you
could run into perf issue or even Out of Memory.
2. Perserve the streaming processing. In Excecute(), listen for
AfterLastRead event on the stream.
InMessage = inmsg;
messagePart = inmsg.BodyPart;
if( messagePart != null )
{
Stream DataStream =
messagePart.GetOriginalDataStream();
evts = DataStream as IProvideReadStreamEvents;
// This is in the Microsoft.BizTalk.Streaming.dll in the GAC, you
may have to copy
}
// it out
to add to reference.
if( evts != null)
{
evts.AfterLastReadEvent += new
AfterLastReadEventHandler(OnLastRead);
}
Else // Someone has replaced and pull the original
stream, you should have all of the properties now.
In OnLastRead, you can set the OTL based on some other context properties.
In your scenario, 2 is recommended.
- Allen Zhang (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
pipeline using the predefined pipeline, i.e in my case "BTAHL72X.." flat
file pipeline. I just want to change the "OutboundTransportLocation" and
the http basic authentication's username and the password based on some
variables/messages. thx. in advance.
|