Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Processing Different Message Types Through The Same Send Port
- This topic has 10 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
November 13, 2007 at 12:50 PM #18406
Hello Everyone:
I have an orchestration that does the following:
- Receives 5 different types of ( positional ) flat file schemas using a parrallel convoy i.e. the orchestration does not go ahead until all files are received.
- Uses a map to combine all 5 of those flat file message schemas into one request message
- Sends the request message to a web service
- Receives a response from the web service
- If the web service process was successful
- move each file ( in its’ original format ) to a processed folder
- Else
- move each file ( in its’ original format ) to an exception folder
That is the main idea. Instead of creating a “processed” and “failure” send port for each file ( yes, that is 10 ports altogether ), I would like to be able to have two send ports ( which I can later configure as FILE locations in BizTalk Admin ) – one for failure and one for successes – in which I can send any one of my flat file messages through which will then be written to the appropriate directory in its’ native format.
I understand that I will need my own send pipeline which I have already created. This pipeline has a flat file assembler in it. I also understand that flat file assembler should know which schema it is dealing with.
The problem is: how do I configure the send port so that it can receive any one of my different flat file schemas and still be recognizable to the flat file assambler I mentioned?
Any thoughts or recommendations are appreciated . Thanks!
Sincerely,
Kevin Parkinson
-
November 13, 2007 at 3:25 PM #18410
With BizTalk Server 2006(and R2) you can call Pipelines inside of your Orchestration. So you can have a message type of String or Raw String that gets sent out through a Static or Dynamic Send Port. I have some sample code on how to run a pipeline inside your orchestration here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2390531&SiteID=1
If you need to go the dynamic port route check this out
http://geekswithblogs.net/edmundzhao/archive/2006/03/06/71555.aspx
-
November 14, 2007 at 12:03 PM #18422
Thanks Kent! In your first article on MSDN, you state “Here is my code for the Send Pipeline…”. Can you clarify what you mean by that i.e. had you written a custom pipeline component?
Kevin
-
November 14, 2007 at 12:13 PM #18423
It is a custom pipeline(but not a custom pipeline component). Basically I have created a pipeline and included my flat file schema as the “document schema”. Note that you can place more than one flat file schema in 1 pipeline and the pipeline will figure out which message type to assemble.
-
November 14, 2007 at 1:00 PM #18424
Kent:
Let’s make sure I am following you here:
- You have one or more receive shapes which receives your flat file schema as a message
- You a Construct Message shape on your orchestration design surface and insert the folowing code into it:
msg_Output_FF = new Helper.RawString();
PipeMsg = new Microsoft.XLANGs.Pipeline.SendPipelineInputMessages();
PipeMsg.Add(msgX);
Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteSendPipeline(typeof
(MyPipelines.SendX),PipeMsg,msg_Output_FF); - Are you then using the returned RawString ( msg_Output_FF ) to send through a Send Port which expects a RawString? Meaning, I could send any type of message I like though my send port and then configure the port in BizTalk Admin to output the text file to a particular directory?
Thanks for your help!
Sincerely,
Kevin Parkinson
-
November 14, 2007 at 9:40 PM #18430
Kevin,
You got it…. Since you are calling the Send Pipelines inside of the orchestration and all of your files are flat files then you can re-use a send port that is sending out messages that are of type “Raw String”.
Kent
-
November 15, 2007 at 10:17 AM #18436
Kent:
I am almost to the pint where I think I can get this working – after initial trouble with referencing the SendImputPipelineMessages in the orchestration and getting the dreaded ‘unknown exception occured’ message – but there is one thing: the ExecuteSendPipeline method expects an XLangMessage as its’ third paramter, and in your code sample I don’t see you doing any cast or anything. What do you suggest? A Cast? Or?
Kevin
-
November 15, 2007 at 1:52 PM #18437
Kent:
Actually, I understand that the 3rd parameter needs to be of type XLANGMessage. So, the RawString is only an XLANGMessage when you create a message variable of type raw string. I need to pass the message variable in.
This is great. I will let you know how it goes when I get it fully implemented.
Thanks.
Kevin Parkinson
-
November 15, 2007 at 5:39 PM #18439
That is right, you will need to provide the name of your message as the third parameter which happens to be of type “Raw String”. Just a word of warning that once a message starts to get up around the 200 mb level that you may start to see .Net Out of Memory exceptions. Hopefully your messages are not this large.
-
November 16, 2007 at 2:45 PM #18451
Kent:
Thanks for mentioning that! In fact, some of my messages will be 2MB or more; I have seen ones that are around 4.5MB. In theory though, couldn’t I replace the RawString with the generic System.XmlDocument and stillk have the flat file data in its’ original format outputted to my send location?
Thoughts?
Kwvin Parkinson
-
November 17, 2007 at 9:57 PM #18452
No, I don’t think you can. I believe you will get some additional tags automatically embedded in your message. They will be <string> tags. If you are talking about 2 or 4 mb don’t worry about it. I only started to see problems at 200 mb.
-
-
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.