Wednesday, January 04, 2006

Temporal Sequencing In BizTalk

Temporal sequencing relates to the ability of a message broker to ensure that messages are sent out in the order in which they are received. In a simple broker this is a simple matter as each message is processed one by one in the order in which they are received. At a very basic level this can be insured by writing the messages to the data store as they are received and thenprocessing messages from the top of the table first.

Within BizTalk this is a larger issue since multiple treads of processing can occur at the same time, and there is no guarantee that each thread will execute at the same rate, or that the amount of processing time will be equal for each message. The processing time will be affected directly by the size and complexity of each message. This is further compounded by the ability of BizTalk to be clustered.

The result of this is that BizTalk does not guarantee the order of messages. It is important to realize this is not a design flaw rather an inherent result of the mechanisms used within BizTalk to ensure scalability and efficiency. Its also worth noting that for the large majority of cases this is not an issue and the speed of the product is far more important than the temporal sequencing of the messages.

In HealthCare however there are a number of valid circumstances where temporal sequencing is required. A good example of this would be admission. If a patient is admitted into a hospital typically an A01 would be raised to show that event. If a admitting clerk then realized that the name was incorrect they would make a change to demographics and this would be represented by an A08. If the A08 is received prior to the A01 by a target system then an error condition would be encountered. That situation is a problem but a worse situation would be where two A08 were sent with the second overriding the first. In that case the target system would end up with the wrong data, with no error raised.

One solution to the problem has been provided by Microsoft on GotDotNet ( Briefly (the documentation explains the problem and solution well) the provided solution utilizes an auxiliary database to track message order. When a message arrives into the receive pipeline an entry is made in a tracking database. When the message leaves the send pipeline the message is checked to ensure that it is the oldest. If it is not, the pipeline returns null and the message is not sent.An additional orchestration is used to insert a hold into the process so that other threads in action have a chance to complete, hopefully releasing the older messages.

The solution is quite simple and can be implemented by the code provided or a similar system can be easily coded.

One word of warning though; by including this mechanism in the broker performance will be impacted for a couple of basic reasons. Firstly the orchestration used to insert a hold will take processing power and time, as will the additional pipeline components used. Secondly each message is not free to process and release as fast as possible.

In the end the system is a trade off. If you require temporal sequencing then you will need to sacrifice some performance. If you dont then do not implement this solution.

(Thanks to Suren MachiRaju for posting this)


At 12:36 PM, Blogger markbrinick0772 said...

I read over your blog, and i found it inquisitive, you may find My Blog interesting. My blog is just about my day to day life, as a park ranger. So please Click Here To Read My Blog

At 4:37 PM, Blogger Jame Healy said...

Just wanted to chime in (and say 'hi'), but just out of curiosity, when you say:

"Temporal sequencing relates to the ability of a message broker to ensure that messages are sent out in the order in which they are received."

Do you mean to say that sequencing relates to the intended sequence of messages regardless of how they are received? For instance, we're not dealing with a FIFO construct, but rather a sequence based on some other parameter. It is possible for the message broker to receive the messages out of sequence itself, so FIFO doesn't help.

... am I right?

At 11:41 AM, Blogger Simon Chester said...

The solution detailed does not re-sequence messages that arrive at the broker out of sequence. Within HL7 there is a concept of sequencing that is prescribed, but unfortunately not implemented in a number of key applications we are using.
If the message control ID is sequential then you could utilize this to control the sequence of outbound messages. However without the control messages associated with HL7 sequencing (resend, restart message number) there is alot of risk associated with this mechanism.
I'll write another post in a bit on the outcome of our work. FOr the moment, suffice it to say the solution is more complez than we originally hoped especially since the implementation of the HL7 solution we are dealing with is very complex.

At 10:51 AM, Blogger andrei.kossoroukov said...

Good thing, the sequencing is included in BizTalk 2006.:)

At 6:37 PM, Blogger crisgibson83320136 said...

Do you want free porn? Contact my AIM SN 'p1nkn3ss' just say 'give me some pics now!'.

No age verification required, totally free! Just send an instant message to AIM screen name "p1nkn3ss".

Any message you send is fine!

AIM abuse can be reported here.

At 12:29 AM, Blogger dwainprehiem59023281 said...

Get any Desired College Degree, In less then 2 weeks.

Call this number now 24 hours a day 7 days a week (413) 208-3069

Get these Degrees NOW!!!

"BA", "BSc", "MA", "MSc", "MBA", "PHD",

Get everything within 2 weeks.
100% verifiable, this is a real deal

Act now you owe it to your future.

(413) 208-3069 call now 24 hours a day, 7 days a week.

At 3:53 PM, Blogger Simon Chester said...

Hmm, gotta say, I'm very impressed with the number of people out there spamming the comments on blogs. Apparently some of it must be successful.

At 7:06 PM, Anonymous Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!


Post a Comment

<< Home