BizTalk zombie management Wiki

Context

What is a zombie?

A zombie message is a message that was routed to a running orchestration from the messagebox and was "in flight" when the orchestration ended. An "in flight" message is a message that has been routed to a service instance and so is in a messagebox queue destined for the service instance. Since the message can no longer be consumed by the subscribing orchestration instance, the message is suspended and marked with a ServiceInstance/State value of "Suspended (Non-resumable)".

A zombie service instance is an instance of an orchestration which has completed while a message that was routed to the orchestration instance from the messagebox was still "in flight". Since the orchestration instance has ended, it cannot consume the "in flight" messages and so is suspended and marked with a ServiceInstance/State value of "Suspended (Non-resumable)".

The occurrence of zombies typically falls into one of the following categories:

Terminate control messages – The orchestration engine allows the use of control messages to cancel all currently running work in a specific orchestration instance. Since the control message immediately halts the running orchestration, zombie instances are not unexpected. A number of Human Workflow related designs tend to use this mechanism as well as some other designs.

Parallel listen receives – In this scenario the service instance waits for 1 of n messages and when it receives certain messages it does some work and terminates. If messages are received on a parallel branch just as the service instance is terminating, zombies are created.

Sequential convoys with non-deterministic endpoints – In this scenario, a master orchestration schedule is designed to handle all messages of a certain type in order to meet some type of system design requirement. These design requirements may include ordered delivery, resource dispenser, and batching. For this scenario, the tendency is to define a while loop surrounding a listen with one branch having a receive and the other having a delay shape followed by some construct which sets some variable to indicate that the while loop should stop. This is non-deterministic since the delay could be triggered, but a message could still be delivered. Non-deterministic endpoints like this are prone to generating zombies.

(source : MSDN)

How does the Zombie Management work

BizTalk Zombie Management is C# service which keep an eye on BizTalk WMI table. When a zombie occur a special BizTalk event is generated and catched for processing.

The service is configured as automatic start and require SSO is started

pre requesite

  • This service is a 64 bit only
  • To install the service you need administrator right
  • The service must run under a BizTalk account
  • For your orchestrations that generates zombie, their receive port correlated need to be a direct port

Installation

You need to install this Service on each BizTalk in your farm

In fact the zombie instance is raised on the BizTalk machine which manage the correlation, and only this machine not the other. That's why you should install it on every BizTalk machine.

Step for installation
  • Download the last version of the project
  • Copy it on your BizTalk server
  • Run BizTalkZombieManagementSetup.msi

01 home screen.JPG
  • Accept the licence

02 choosing path.JPG
  • Select the path

03 summary.JPG
  • This is the summary
  • At the installation end , the setup will ask you for account will which execute the service. Here put the BizTalk account, or another account which have the same rights
04 user.JPG

Configuration

Configuration is available by wpf tool. You'll find in the start menu at : BizTalk Zombie Management -> Configuration Tool
Once started this windows appear :
configuration Tool.PNG

If it's the first time, the service is not started.
Before start it with the command button, you must configure which layer you'll use to republish your message
Three layer are available :
  • File
  • MSMQ
  • WCF

File layer

This is the simpliest layer. you just have to give a valid dump folder. In BizTalk administration, you need to add a receive port with File adapter and Xml Receive Pipeline

Next click "save configuration" and then start service

MSMQ layer

If you select this one, you need to provide Msmq URi with this format {Hostname}/{public-private...}/{QueueName}
In bizTalk Administration, you have to add a receive port with MSMQ adapter and Xml Receive pipeline

Next click "save Configuration" and then start the service

WCF layer

For wcf, I implemented three binding :
  • NamedPipe
  • TCP
  • WsHttp

After selecting a binding and provide a valid URL, you need to add a receive port in BizTalk administration console. I provide with the installer some binding file file for each WCF support. You can find it at {InstallDir}\BizTalk Zombie Management\Binding

You can add one of them in your BizTalk solution. Of course you can change the URI

Next Click "save configuration" and then start the service

NOTE

By Default, there is no security on binding, but you can turn on by modifying the service configuration file :
  • First open the configuration tool (if it's not done yet)
  • Stop the service
  • Next, open {InstallDir}\BizTalk Zombie Management\BizTalkZombieManagement.exe.config file
  • Modify security in your current binding in ServiceModel section
  • Restart the service
  • If the service doesn't work please contact me, and explain the case

How to use it

Once installed and configured, the service start only if Enterprise single sign on is up.

how to monitor it

To see the service activty, I implemented a performance counter :
performance Couner.PNG

This counter reset each start. It will permit to know how many message are saved and reprocessed

Last edited Nov 4, 2012 at 6:39 PM by JeremyRONK, version 12

Comments

JeremyRONK Sep 17, 2014 at 10:00 AM 
Import the corresponding binding file, it will create the receive port that will receive the posted message

huylx1601 Feb 25, 2014 at 6:16 AM 
Hi,
I'm very interesting this tool. I'm trying to use it. I haven't still understood how to use WCF layer. Can you explain more detail this ? Thank you so much.