So I have been using the generated WMI Classes from the Management (WMI) Extensions for Visual Studio .NET 2003 Server Explorer to build yet another version of a Suspended Queue Listener for when Biztalk Suspeneds a message in our FIFO solution. 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.
Here is the snippet:
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 );
}
}
Anybody have any ideas?