ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » How to find Queue depth using C

Post new topic  Reply to topic
 How to find Queue depth using C « View previous topic :: View next topic » 
Author Message
jarun111
PostPosted: Wed Jun 08, 2005 6:15 am    Post subject: How to find Queue depth using C Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Jun 08, 2005 6:17 am    Post subject: Reply with quote

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
View user's profile Send private message
jarun111
PostPosted: Wed Jun 08, 2005 6:32 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Jun 08, 2005 6:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » How to find Queue depth using C
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.