Dot Net Dunk

Wandering in the land of .NET
posts - 42, comments - 22, trackbacks - 187

My Links

News

Archives

Post Categories

Blog Roll

Document splitting post-receive

An interesting scenario came up this afternoon. I receive a bunch of different documents containing address changes, which I map to my canonical "address changes" format in the receive port. I then want to split my canonical document using an envelope so that each address change record is out on its own.

As far as I can see, to do this I'm going to have to write the canonicalised document out to disk, then read it back in from disk and split it in the corresponding receive pipeline. This feels awfully inefficient, but luckily it's only for a demo system.

I know that the messagebox allows for far more sophisticated subscriptions than are exposed through the User Interface, and obviously orchestrations can subscribe based just on document type, but does anyone know of an equivalent to "The Messagebox" as a receive location transport type?

On a side note, the lack of blogging recently is entirely down to being on holiday, and an addiction to Halo 2 on XBox Live :-) If anyone fancies a game, invite me over to your party - the gamertag is "shelfsider". I'm varying between level 3 and 5 depending on the gamemode, so not too tough an opponent!

Update

Thanks to my colleague Charles and to Berneba (via comments) for the suggestion of using a loopback adapter. In this case it's probably not going to work as I'm trying to split the document and it's not clear what I'd receive back into the orchestration.

For the purposes of the demo system I'll stick with taking a hop onto the disk, but Darren Jefford's post about looping gives some good ideas - particularly using the little known xpath function.

Print | posted on Monday, December 06, 2004 4:32 PM | Filed Under [ BizTalk Server ]

Feedback

Gravatar

# re: Document splitting post-receive

Someone wrote a Loopback Adapter for BT04. Is that what you would need to execute an extra receive pipeline with the envelope and split stuff?
12/6/2004 4:58 PM | Bernabe
Gravatar

# re: Document splitting post-receive

Duncan,

It is strange that the xpath function in orchestrations is not better known. Next time you create an expression shape, you will see several examples of how to write an expression at the top of the dialogue box. Included is an example of the xpath function... right there in your face, hiding in plain sight. I had not spotted it until recently! Although this example is fab for putting it to good use: http://dajd.members.winisp.net/Manual%20Message%20Splitting.zip

James
12/8/2004 8:50 PM | James Saull
Gravatar

# re: Document splitting post-receive

Stephen Thomas blogged over the weekend on this subject - he did a performance comparison of various approaches to to shredding/de-batching/disassembling(whatever). His tests suggested that the xpath function, for all its power and flexibility, is actually very slow, although it remains his favourite approach.

http://www.geekswithblogs.net/sthomas/archive/2004/12/12/17373.aspx

On the project I'm current working on, we shred messages by iterating over a node list within an orchestration (one of Stephen's approaches). The main reason for doing this is that the XML message is 'anonymous' (no namspaces), and has a document element named 'Response'. We can't change this. The XML is delivered via a web method wich returns strings. I really wanted to avoid, at all costs, having to creat a schema for this horrible XML, which I would have had to do in order to use the XmlDisassembler in a pipeline. I could forsee the possibility of future integration requiring conflicting schemas for other types of response message.

The approach works really well. Each shredded message is constructed with an envelope that provides a default namespace and then delivered back to the message box where it is correlated onto another (calling) orchestration. I use a context property to indicate the last message in the batch.

Just to say again - there is no way you can have a receive port subscribe directly to the messagebox - there is no mechanism for this in BizTalk. Loopback adapters are the closest you can get to the model you are looking for.
12/13/2004 11:31 PM | Charles Young

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 2 and 2 and type the answer here:

Powered by: