Resequencer Pattern — A new thought

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Resequencer Pattern — A new thought

Viewing 0 reply threads
  • Author
    Posts
    • #23803

      I wish to validate my thought regarding a new way of end-to-end ordered delivery which is slightly different from the normal resequencer pattern:

      If you intend to implement end-to-end ordered processing using ESB Toolkit 2.0 and moreover wish to ensure that the solution be scalable then there is one small caveat which needs to be overcome. That is dynamic send ports do not support ordered delivery property. Now in order to overcome this the following needs to be done.

      1. In the orchestration receive port set the ordered delivery to true.
      2. It is assumed that BatchID would be there for a batch of messages, hence use that in correlation set to set up a sequential convoy such that only one orchestration instance serves a batch of messages. For next batch another instance and so on.
      3. Add a SequenceNo to the property schema and set its property schema base property to MessageContextPropertyBase.
      4. Within orchestration, depending upon the message content, set the SequenceNo of the message and use an updategram to push the message to a SQL Server table. The stored procedure used for this purpose should fill the value of an extra “status” column as “Initialized”.

      Now another orchestration has to be used. For this first add a receive location with adapter as SQL Adapter.

      5. The SQL adapter polls the table where message is srored and picks up one message with highest/lowest SequenceNo value depending upon in which order you wish to process the messages. Upon picking up the message the “status” column should be updated to “Processing” such that when SQL adapter tends to pick up another message from the table eventually to fire another orchestration instance, it finds that the message with highest/lowest SequenceNo has status as “processing” and it doesn’t do anything.

      6. Once the processing is over, at the end this orchestration uses an updategram to change the status to “Completed”.

      7. The SQL Adapter at the receive side continues polling and finds that the message with highest/lowest SequenceNo is having status as “Completed” and hence it goes ahead and picks up the next highest/lowest SequenceNo message.

      Thus end to end ordered processing is ensured irrespective of whether you use MSMQ at the receive side or not. This solution would give optimum performance alongwith high scalability as no in-memory processing is done like normal resequencers in BizTalk. So even if thousand messages arrive in a batch, it would pose no problem to the application.

Viewing 0 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.