Using Generated WMI Classes to Query for Suspened Messages

Home Page Forums BizTalk 2004 – BizTalk 2010 Using Generated WMI Classes to Query for Suspened Messages Using Generated WMI Classes to Query for Suspened Messages

#12923

So I have been using the generated [b:ebb35963e6]WMI Classes from the Management (WMI) Extensions for Visual Studio .NET 2003 Server Explorer [0][/b:ebb35963e6] to build yet another version of a [b:ebb35963e6]Suspended Queue Listener [1][/b:ebb35963e6] for when [b:ebb35963e6]Biztalk Suspeneds a message in our FIFO solution [2][/b:ebb35963e6]. Anyway I ran into snag after the event fires. I get the suspended instance id without a problem but when I use the GetInstances with a SerivceInstanceID clause I only get one message, even when the suspended instance could have 2 or more messages suspended within it.

Anybody have any ideas?

[0] – http://geekswithblogs.net/gwiele/archive/2005/03/16/26469.aspx
[1] – http://martijnh.blogspot.com/2004/07/biztalk-2004-suspended-queue-listener.html
[2] – http://blogs.msdn.com/biztalk_core_engine/archive/2004/06/30/169430.aspx

[code:1:ebb35963e6]

const int Zombies = 16;

ServiceInstance.ServiceInstanceCollection serviceInstances = ServiceInstance.GetInstances( String.Format( \"ServiceStatus=’{0}’\", Zombies ) );

foreach ( ServiceInstance SuspendedInstance in serviceInstances )
{
MessageInstance.MessageInstanceCollection messageInstances = MessageInstance.GetInstances( String.Format( \"ServiceInstanceID=’{0}’\", SuspendedInstance.InstanceID ) );

foreach( MessageInstance SuspendedMsg in messageInstances )
{
Console.WriteLine( SuspendedMsg.MessageInstanceID );
}
}

[/code:1:ebb35963e6]