|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
getCurrentDepth() not working (java) |
« View previous topic :: View next topic » |
Author |
Message
|
mig |
Posted: Thu May 16, 2002 4:42 am Post subject: getCurrentDepth() not working (java) |
|
|
Newbie
Joined: 16 May 2002 Posts: 2
|
Hi all,
I have problems to find out how many messages are currently in my queue. After looking in the API I found the MQQueue.getCurrentDepth() method but it always throws an exception.
Is this the right method to use to find out how many messages are in the queue or is there another way? If it's the right one, what should I check to ensure that the method works fine?
Thanks in advance for your help! |
|
Back to top |
|
 |
bower5932 |
Posted: Thu May 16, 2002 2:42 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
It works fine for me. What kind of exception are you getting? If it is a 2038, then you need to open the queue for inquire:
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE;
MQQueue myQueue = qMgr.accessQueue(myQname, openOptions, null, null, null);
System.out.println("Curdepth = " + myQueue.getCurrentDepth()); |
|
Back to top |
|
 |
mig |
Posted: Fri May 17, 2002 6:49 am Post subject: |
|
|
Newbie
Joined: 16 May 2002 Posts: 2
|
thanks for your help, I opened the queue without the MQC.MQOO_INQUIRE flag and finally this seemed to be the problem.
I tried with MQC.MQOO_INQUIRE and everything works fine.
Thanks for your rapid help! |
|
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
|
|
|
|