by stephen-w-thomas | Mar 30, 2005 | Downloads
The flat file disassembler can produce single record output or a single batch output. This sample shows how to accomplish each task when you need it. Make sure to read the blog content below for additional information.
This sample should work with BizTalk 2004 and BizTalk 2006.
Get more information from the original blog post on this topic: http://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2004/12/17/flat-file-disassembler-output-types-in-biztalk-server-2004.aspx
by stephen-w-thomas | Mar 29, 2005 | Stephen's BizTalk and Integration Blog
Recently I have seen a lot of talk about large message support in BizTalk 2004. The most interesting and depressing was on the BizTalk Core Engine WebLog. It seems that large messages do not work as well in BizTalk 2004 as I would have hoped.
I have had success with some types of large messages using the file adapter and mapping. I have gotten it to work with messages up to 500 MB but in a production environment this would not be a viable or supported solution.
During some recent testing, I discovered the follow condition that rather surprised me.
Scenario
I was returning an unpredictable amount of data out of an Oracle database using .net code. This data can be 1 MB or up to 250MB+ and needed to be processed in a single batch. This data is then converted into Xml, cast to a message, and mapped with the results written to disk using a Send Shape. Life was good until the extracted data returned was greater then 220 MB in size.
At this point, everything went downhill. BizTalk Server began to have serious problems. Receive functions were shutting down and I received the following Warning message in the Application Log:
A catastrophic failure occurred in the BizTalk service. The service will shutdown and auto-restart in 1 minute. If the database is still unavailable, this cycle will be repeated.
Error message: Exception of type System.OutOfMemoryException was thrown.
Error source:
BizTalk host name: BizTalkServerApplication Windows service name: BTSSvc{E93E7C4A-9E8B-40F6-AD7C-4F53B85F36C4}
For more information, see Help and Support Center at
All appears to be well and good since BizTalk seems to be handling the situation as expected… except for when the service actually starts again. Since the Orchestration that caused the fatal error is still Active (the Orchestration itself did not through any errors), BizTalk starts to process the Orchestration from the last persistence point. Thus, repeating the cycle in an endless loop.
Now, for the interesting behavior… If this is running in a multi server BizTalk environment at the point the 1st BizTalk Server fails the 2nd one picks up; like I would expect. I end up getting a completed Orchestration with no errors. Super! But, I only get a zero byte file as output. So, looking inside HAT everything would look like it completed successfully with no errors. Not good…
Overall, I found that an Orchestration seems to be able to handle about 440 MB of “stuff” before it crashes. Just make sure you know what makes a copy of the message (like mapping). Of course, processes with this amount of data would not be supported nor do I recommend actually doing it. But, it has been fun to play around with and see what fails.
The moral of this story is to be very mindful of your message size.
by stephen-w-thomas | Mar 21, 2005 | Stephen's BizTalk and Integration Blog
It is a common request. How can I debatch a message into smaller batches rather than single messages inside BizTalk 2004?
I have tried many times to get this accomplished natively inside the pipeline. One would think it would be as easy as setting the group property to 10 if you wanted a batch size of 10, but that does not seem to work. The only way I have been able to break up a message into smaller batches has been inside custom code.
I wrote a .net component that can be called using an atomic scope shape from inside an Orchestration. This component will return smaller batches of any size you specify inside the Orchestration and wrap the smaller batches inside a specified root node. This .net component uses the XmlTextReader to stream the message along and debatch it.
This .net component is called StreamHelper. It illustrates the following:
- Using XmlTextReader
- Passing an Xlang Message into a .net component
- Returning an Xlang Message from a .net component
- Setting context properties on a message returned from a .net component
Download: Debatch Streaming Sample
Setup: Download and extract the solution. Build and GAC the StreamHelper assembly then Build and Deploy the DebatchProperties and DebatchOrch assemblies. I have included a basic sample file to test with. For more detailed information on the sample see the comments throughout the solution.
A better way to do it?
I’m sure there is. I just put this together in a short amount of time. I would guess the most efficient place for this type of work would be inside a custom pipeline component. But, working with custom pipelines can be difficult.
How does this debatching approach perform compared to the others?
Performance was almost identical to that of the Xml Node List inside an atomic scope. In this sample, I used the XmlTextReader and passed Xlang messages in and out of the component to try to increase performance. That did not seem to accomplish anything. As expected, as the total number of messages inside the atomic scope increased the performance decreased.
Type |
XML Size (MB) |
# Nodes |
Batch Size |
Time (Sec) |
Msg/Sec |
Msg Size (kb) |
.net Stream |
1.6 |
500 |
1 |
5 |
100.0 |
3.0 |
.net Stream |
3.6 |
1100 |
1 |
18 |
61.1 |
3.0 |
.net Stream |
7.2 |
2200 |
1 |
44 |
50.0 |
3.0 |
.net Stream |
18.1 |
5500 |
1 |
224 |
24.6 |
3.0 |
.net Stream |
128.6 |
38500 |
1 |
— |
FAIL |
— |
.net Stream |
1.6 |
500 |
10 |
1 |
500.0 |
3.0 |
.net Stream |
3.6 |
1100 |
10 |
3 |
366.7 |
3.0 |
.net Stream |
7.2 |
2200 |
10 |
9 |
244.4 |
3.0 |
.net Stream |
18.1 |
5500 |
10 |
15 |
366.7 |
3.0 |
.net Stream |
128.6 |
38500 |
10 |
159 |
242.1 |
3.0 |
For more debatching information please see my past post:
Debatching Options and Performance Considerations in BizTalk 2004
by stephen-w-thomas | Mar 21, 2005 | Downloads
Debatching into single messages is easy with BizTalk 2004. This sample shows how messages can be groups into batches of any size inside an Orchestration using an external .net component. The external .net component uses streams to read the message from an Orchestration. The message is passed into the component as an XLang message type.
This sample should work in BizTalk 2004 and BizTalk 2006.
Get more information from the original blog post on this topic: http://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2005/03/22/debatching-messages-into-smaller-batches-in-an-orchestration.aspx
by stephen-w-thomas | Mar 8, 2005 | Stephen's BizTalk and Integration Blog
The help guide gives many excellent examples of using WMI to perform a large variety of useful tasks in BizTalk 2004.
One of the little known features is the ability to have suspended messages saved to a file at the time of suspense. I would assume this is govern by the same rules of viewing tracked messages in HAT, that is the stream must be seekable for the message to be tracked and in this case saved (see Christof’s Blog Post).
What makes this feature so nice is it saves both the message and the context to a file. This can be great at tracking down routing failures, convoy problems, and general correlation issues.
I have put together a simple tool that can be run anytime you want to view the suspended messages and context. Just deploy the sample to your C:\ drive. The suspended messages are written to C:\SampleWMI\OutputMessages.
Download: WMI Suspended Instance Sample
by stephen-w-thomas | Mar 8, 2005 | Downloads
This tool can be used to monitor BizTalk Server 2004/2006 for suspended messages. Once a suspended message is detected, the message and the message context is written to disk for easy viewing.
Get more information from the original blog post on this topic:http://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2005/03/09/wmi-suspended-instances-for-biztalk-server-2004.aspx
by stephen-w-thomas | Feb 25, 2005 | Downloads
Naming output files is always tricky. This sample shows how to use message context properties to control the name of output files.
BizTalk 2004 has two ways to dynamically name your files from inside the Orchestration. The two ways to accomplish this are either to use a Dynamic Send Port or to use the %SourceFileName% macro on the Send Port.
This sample should work with both BizTalk 2004 and BizTalk 2006.
Get more information from the original blog post on this topic: http://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2004/11/13/how-to-name-output-files-inside-an-orchestration.aspx
by stephen-w-thomas | Feb 25, 2005 | Downloads
This is a simple Orchestration to catch Nack’s. Nack’s are Negative Acknowledgements returned from failed BizTalk messages. This Orchestration can be modified to react to specific exceptions as needed.
This sample should work in BizTalk 2004 and BizTalk 2006.
Get more information from the original blog post on this topic: http://www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalk/archive/2005/05/26/nack-message-processing-orchestration-for-biztalk-server-2004.aspx
%ufeff
by stephen-w-thomas | Feb 16, 2005 | Stephen's BizTalk and Integration Blog
Yesterday Microsoft released a BizTalk 2004 Adapter for MSMQ v2.0. This works with MSMQ 2.0 and 3.0.
Here are the key features from the download site:
The BizTalk 2004 Adapter for MSMQ provides support for sending and receiving messages using MSMQ 2.0 and 3.0, and takes advantage of the new features in MSMQ 3.0. Major features of the adapter include support for:
• MSMQ 2.0 and 3.0
• Multi-threading option for faster performance
• Guaranteed delivery when using transactional queues
• Reading from remote non-transactional queues
• Dynamic send ports
• Support for messages up to 2 Gigabytes in size
Download this adapter here.
by stephen-w-thomas | Feb 11, 2005 | Stephen's BizTalk and Integration Blog
I guess these came out several days ago. I did not hear about it until now.
Anyways, updated BizTalk 2004 Documentationisavailable here.