Blogging BizTalk

Lets Discuss BizTalk

Error Message Routing Pattern demo In BizTalk


This topic deals with Error Message Routing Pattern Demo.

Where can you use this? One of the examples may be when your send port end point is erroring out or the subscriber to a RP is unavailable for some reason(For example may be a a send port working in a time window) then you will bump into a scenario where in a message comes in on a receive port and doesn’t finds a subscriber which it would have had it come between the defined time window or  where you may see the Zombie message scenario (Let me accept it is not a very ideal solution to handle the Zombies but may fit your need, one never knows).   It is going to leave you unconsumed messages suspended messages in BizTalk, if you choose to terminate them it can lead to data loss scenario . Even if you resume these messages they going to suspend back because there instance subscription is no longer valid(In case the response was to consumed by orchestration). You may want to handle them and this is one of the way on How can you do it.

I am trying to demo how can handle this.

Lets Create The Non Subscribed Orphaned Message Scenario

1>Create a receive port with the “Enable Routing Failure For Failed Message” ticked in.

RcvPort

2>when you drop a message which has the subscriber defined it will be consumed by the respective BizTalk artifact. Now if you drop a message which has no subscriber defined: You will have a suspended message with no subscriber found error. So you have your orphaned message created at this point in time.

The need is to handle it and route it to appropriate destination. This is how you are going to handle this.

3>Create an directly bound to message box orchestration with the following  subscription

(ErrorReport.ReceivePortName == “Your receive Port Name Where You Are Expecting The Orphaned Or Zombie Scenario To Occur”)

In case your orchestration has to subscribe to the failed messages at a send port then above property will be changed to ErrorReport.SendPortName.

Define the business logic you may need in this orchestration.

4>Once you start this orchestration you will no longer see the suspended messages, all of them would have been consumed by them. However you will still see a suspended non resumable routing failure class report which is a kind on notify only event from BizTalk. You will have to clean them once in a while.

On the send side if you need error routing here is the property needed to be selected:

Untitled

 Note: In case you need to create  Zombie message scenario then design a sequential convoy orchestration and once it exits the collect loop add a delay of 1 minute in logic. So if during the delay of 1 minute you drop a message for this orchestration it will behave as Zombie.

This Is How It Works

  1. BizTalk Receives messages  on  Receive Port : Your receive Port Name Where You Are Expecting The Orphaned Or Zombie Scenario To Occur
  2.   If any of the message coming into the BizTalk server doesn’t finds a subscriber message will get suspended and create non resumable “Routing Failure Report”
  3.   Now post suspension the Receive port is configured to handle a failure by creating a promoted failed error property for the message : ErrorReport.ReceivePortName .
  4. The orchestration handling the orphaned message  is listening on any message  error property(ErrorReport.ReceivePortName) on the same receive port which suspended the message, which is now created(Note: The property only gets promoted  after the message is suspended)
  5. The orchestration handling the orphaned message subscribes to the failed message and does its business logic to route to destination system.

Please leave a comment if you have any questions or need the source code. I will reply back as soon as I get time.

Thanks

Advertisements

10 responses to “Error Message Routing Pattern demo In BizTalk

  1. Pulkit Agrawal July 1, 2014 at 7:26 am

    Will this property be promoted if the error generated is due to an ill-formed xml ??? (Assuming the receive location is configured to accept xml files).
    I tried doing this, but the property ErrorReport.ReceivePortName was not promoted and the message was not subscribed by the orchestration.
    Why is it so that in case of ill-formed xml messages, this property is not promoted.

    • Pushpendra Singh July 1, 2014 at 11:20 am

      It will be promoted for any message arriving on the receive port and not finding a subscriber, did you try checking the context of the suspended message.

      • Pulkit Agrawal July 1, 2014 at 11:37 am

        Yes I did that. I found the actual reason for this not working.
        I am using BizTalk 2013 and XML Receive pipeline in BT 2013 allows malformed XML messages to pass through without any error. So the error I am receiving is actually from the orchestration and not from Pipeline.

        Anyways, thanks for your response Pushpendra.

      • Pushpendra Singh July 1, 2014 at 1:26 pm

        Glad it worked Pulkit, Thanks.

  2. Mike July 2, 2014 at 12:15 am

    Nice, how to implement it around zombie scenarios.
    Can I get the code.

    • Pushpendra Singh July 2, 2014 at 12:18 am

      create an orchestration with a subscription having same message type as the Zombie causing convoy orchestration activate msg and the rcvport error property equal to the RcvPort from where those messages are getting published into msgbox. ensure the handler orchestration follows the same logic as the convoy orchestration….. your zombie handling orchestration is ready..I do not have code specific to this Zombie situation .I am going to inbox the more generic version to you.Try tweaking it .Let me know

  3. Nazeer July 2, 2014 at 5:57 am

    Very nicely done, Thanks!

  4. gsampath July 3, 2014 at 4:43 am

    Reblogged this on Gihan's Blog.

  5. Pushpendra Singh July 3, 2014 at 2:26 pm

    Thanks Nazeer and Sampath

  6. Manohar December 22, 2016 at 5:46 pm

    Can you please send the code so that it would be more easy to understand.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

D Goins Insperience

Technological outformation for this day and age

[INACTIVE BLOG] Connected Thoughts - Thiago Almeida

Connected systems and the occasional picture

Uri Katsir's Blog

BizTalk , BizTalk RFID and .NET

prashantbiztalkblogs

My BizTalk Experiences

BizTalk Server Tutorial

BizTalk Server Concepts and Common Errors

Extremely Talented Monkeys

A Technical Blog by Ed Jones: Azure, .NET, BizTalk, WCF, and SQL Server

On All Things Web

Discussing web development without limits

Vikas Bhardwaj's Blog

Articles about BizTalk Server and .NET C#

Cloud develop

a blog about (cloud) development... because I'm a nerd

Hooking Stuffs Together

My learning logs from day to day work experience about Integration platform using Microsoft technologies.

Connected Pawns

Mainly BizTalk & Little Chess

jhelatissimo

a blogger in the process.

MS Innovations Blog

Tips, Tricks, and Workarounds for BizTalk and other Microsoft technologies

srirambiztalks

Katradhu Kaialavu,Kalladhadhu Ulagalavu!

Vijay Microsoft Technical

BizTalk, WCF, ESB ToolKit, Windows Azure

Mind Over Messaging

Musings on BizTalk, Azure, and Enterprise Integration

%d bloggers like this: