Click here to Skip to main content
15,915,319 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using the following code to check for MQ Manager upstatus.
IBM.WMQ.MQQueueManager lObjMQManager = new IBM.WMQ.MQQueueManager(lStrQueueManagerName, lStrChannelName, lStrConnName);
                    if (lObjMQManager.OpenStatus == true)
                    {
                        lBoonIsConnected = true;
                        lObjMQManager.Disconnect();
                        lObjMQManager.Close();
                        lObjMQManager = null;
                    }
                    else
                    {
                        lBoonIsConnected = false;
                    }

But I want to know whether Queue is up or not. How can I achive this. Is there any sample message that I can send and check like below…
lObjQueue.Put(lObjQueueMessage, lObjQueuePutMessageOptions);

is there any way for this..
Please help.
Thanks
Sreenath
Posted
Updated 14-Jul-11 7:34am
v3

1 solution

I would suggest that you call the CreationDateTime property for the queue, as I believe that if the queue is dead it will throw a MQException error

C#
try
{
  DateTime t = lObjQueue.CreationDateTime;
  ...
}
catch(MQException ex)
{
  // Log error
  ... 
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900