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

Viewing 1 reply thread
  • Author
    Posts
    • #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]

      • #12924

        It is the service (orchestration) that is getting suspended. The race condition occurs when a message is being posted to the message box about the same time that a service that belongs to that paricular correlation set is being shut down (discarded) will suspended the remaining messages of the set. So there can be one or more messages in the suspeneded instance.

        To verify that there is more than one message I can run the query without specifing the service instance id and there are all the messages, in the suspended state, that really belong to the suspended instance. That is why this is driving me crazy!

    • #12922

      I’m just guessing here but I would think if it’s a message that is getting suspended you would just have one message.

      If it was an Orchestration, then maybe the messages are in some other state other than suspended. I tried to run a test, but my HAT isn’t working on my laptop for some reason

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