Default buffer size BizTalk used to read stream in pipeline compon

Default buffer size BizTalk used to read stream in pipeline compon

Post by VG9tbX » Fri, 10 Mar 2006 08:54:29


As one of the project requirements is to analysis the flat file before
disassembling to XML, I am creating a pipeline component that similar to the
solution 'FixMsg' in the SDK, that is, to create a custom stream and override
the 'Read' function.

My concern is, since I am trying to load exactly one line from the flat
file, I have to guarantee when BizTalk calls my component, it will 'read
more' bytes than the bytes of what I am returning. i.e. my line is of 300
bytes, if BizTalk buffer size is 100, then the function will crash. Since
the flat file structure is really complicated, the ability to read the
entire record is critical to the solution.

By doing some test, that buffer size used by BizTalk on my PC is 1024, in
this situation, I am in good shape. But can I make an assumption that it will
be same on others?
 
 
 

Default buffer size BizTalk used to read stream in pipeline compon

Post by MV » Fri, 10 Mar 2006 09:02:57

Tommy,


I think you're probably safe to think it will be the same, but who knows
what might change that?

I think it would be best if you didn't rely on it at all. It really isn't so
hard, just means that youre virtual stream needs to do buffering on it's
own. For example, BizTalk reads the first 100 bytes, but the first line is
250 bytes long. You read 250 bytes into your internal buffer, do the
validation, and return the first 100. Now BizTalk asks for the following 100
bytes, which you can just read from your interal buffer without actually
reading the underlying stream. Now biztalk asks for 100 more bytes, and now
you read the next line which is 150 bytes long, append it to the buffer, do
the validation, and return the last 50 bytes from the first line and the
first fifty from the other.


--
Tomas Restrepo
XXXX@XXXXX.COM
http://www.yqcomputer.com/

 
 
 

Default buffer size BizTalk used to read stream in pipeline compon

Post by twang09 » Fri, 10 Mar 2006 13:29:33

Thanks a lot for the briliant idea. I think that would work, I will try
that and post my feedback here.

However, I still wish MS could someday tell us how much that buffer is
and whether it changes or not.
 
 
 

Default buffer size BizTalk used to read stream in pipeline compon

Post by twang09 » Fri, 10 Mar 2006 13:34:54

Good idea, thanks, Tomas. However, I still wish MS could reveal the
secret of that buffer size someday. :)