Connected Thoughts – Thiago Almeida

November 26, 2008

BizTalk Ordered Delivery – One way HTTP receive and SQL Send port

Filed under: BizTalk — Thiago Almeida @ 12:48 pm

I’ve done some experimentation around this as a proof of concept a while ago. With all the hundreds of posts on Dublin and Oslo and .NET 4.0 there’s nothing better than to relax with a bit of BizTalk :)

To ensure ordered delivery between a one way http receive location and a SQL send port I had to set ordered delivery on the receive port in the orchestration and create a singleton orchestration with correlation.

As I expected, just setting ordered delivery to true on the orchestration port and on the final destination send port does not work. You need a correlation in there so that the same orchestration processes the messages that need to be processed in order. I created a correlation on the receive port’s name (BTS.ReceivePortName) so the orchestration is always running and looks like this:

OrderedDelivery1

This is the ordered delivery set to “True” when you select the receive port on the orchestration surface:

OrderedDelivery2

With this I had my test app create 80 http requests alternating between a large file (Anne Lotsachildren) then a small file (Julie Fewchildren) and the results were always correct:

OrderedDelivery3

If I didn’t use a correlation and a singleton orchestration it did not ensure the order, even when setting the orchestration port to ordered delivery and the final send port to ordered delivery without the correlation. BizTalk just initializes a new orchestration instance and processes the message.

To quote from the BizTalk help:

Conditions for End-to-End Ordered Message Processing

To provide end-to-end ordered delivery the following conditions must be met:

  • Messages must be received with an adapter that preserves the order of the messages when submitting them to BizTalk Server. In BizTalk Server 2006, examples of such adapters are MSMQ, MQSeries, and MSMQT. In addition, HTTP or SOAP adapters can be used to submit messages in order, but in that case the HTTP or SOAP client needs to enforce the order by submitting messages one at a time.
  • You must subscribe to these messages with a send port that has the Ordered Delivery option set to True.
  • If an orchestration is used to process the messages, only a single instance of the orchestration should be used, the orchestration should be configured to use a sequential convoy, and the Ordered Delivery property of the orchestration’s receive port should be set to True.

As you might expect this performs a lot worse than if you don’t have ordered delivery and a singleton – but it is very useful if ordered delivery is your priority.

 

Download the sample code here

 

Enjoy!

Thiago Almeida

November 10, 2008

Latest version of the Microsoft ESB Guidance announced

Filed under: BizTalk — Tags: , , , , , — Thiago Almeida @ 8:18 am

The Enterprise Service Bus Guidance is Microsoft’s Patterns and Practices and the Connected Systems Division’s implementation of an ESB using BizTalk Server and the Enterprise Library. Not only the guidance implements a wide range of ESB scenarios, it also includes several great extras like a management portal, exception management, a lightweight mapping service, amongst others.

Version 2.0 of the ESB Guidance has been announced on Microsoft’s “Public Sector Developer Weblog” including an exciting list of new features. This release is implemented on the first beta of Microsoft BizTalk Server 2009 (to be released soon) and Enterprise Library 4.0, and should be available for download at the guidance website in the next few days.

Blog at WordPress.com.