|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to find Queue depth using C |
« View previous topic :: View next topic » |
Author |
Message
|
jarun111 |
Posted: Wed Jun 08, 2005 6:15 am Post subject: How to find Queue depth using C |
|
|
Acolyte
Joined: 19 Apr 2004 Posts: 70
|
Hi,
How do I find the queue depth of a queue making use of C API. I am aware of the queue depth variable in C library, but it returns me a negative number instead of original depth. Any thought would be very helpful.
Thanks
Arun |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 08, 2005 6:17 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Usually, the only programs that should know the queue depth are monitoring programs. Applications should read the queue until it's empty, or put messages until they get an error that says the queue is full and then *stop*.
But you can use the MQINQ verb to get the queue depth.
You can also create a PCF message and get back a response message that tells you the depth of a queue.
You can not get the depth of any queue that is not a QLOCAL. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jarun111 |
Posted: Wed Jun 08, 2005 6:32 am Post subject: |
|
|
Acolyte
Joined: 19 Apr 2004 Posts: 70
|
Thanks Jeff.
Sorry I am using C++.When I use ImqQueue.current depth it returns me a negative number. Any thoughts? Do I need to start any service on the Queue manager side? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 08, 2005 6:49 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I don't know what ImqQueue does - whether it does an MQINQ or a PCF.
I'd guess that a negative number indicates an error, though.
I don't remember my C++ MQ API very well. Have you tried putting the call in a try/catch to see if it throws an error as well as returning a bad value?
If ImqQueue.current depth uses PCF, then you probably don't have a command server running on the qmgr.
If it uses MQINQ, then either you are trying to inq on a queue that is not a qlocal, or you do not have inq permissions on the queue.
But again, and I really can't stress this enough, if you are not writing a monitoring application, you should not write your code to care about qdepth. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|