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 Java / JMS » A question about getting 'CurrentDepth' from the PUT-Queue

Post new topic  Reply to topic
 A question about getting 'CurrentDepth' from the PUT-Queue « View previous topic :: View next topic » 
Author Message
thomas2004
PostPosted: Thu Nov 13, 2008 7:43 am    Post subject: A question about getting 'CurrentDepth' from the PUT-Queue Reply with quote

Novice

Joined: 13 Nov 2008
Posts: 16

Hi all,

I want to do some test such as to check the current depth of a queue.
I use only one option to open the queue: MQC.MQOO_INQUIRE. But I encounter something strange as descriebd as follow:

After I sent a message to the RES-Queue, the current depth is 1. This is correct.

After I sent a message to the PUT-Queue, the current depth is 0. But I can read a message from this queue. Why?
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Nov 13, 2008 8:08 am    Post subject: Re: A question about getting 'CurrentDepth' from the PUT-Que Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

thomas2004 wrote:
I want to do some test such as to check the current depth of a queue.


Why? The only thing that would need to know is a monitoring application, and commercial ones are a better option.

thomas2004 wrote:

I use only one option to open the queue: MQC.MQOO_INQUIRE. But I encounter something strange as descriebd as follow:

After I sent a message to the RES-Queue, the current depth is 1. This is correct.

After I sent a message to the PUT-Queue, the current depth is 0. But I can read a message from this queue. Why?


Current depth is affected by a wide variety of factors, like the committment of the message.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Thu Nov 13, 2008 10:05 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Current Depth is more useful in determining the potential capacity for putting more messages to the queue, rather than the potential # of messages that can be gotten from the queue.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
thomas2004
PostPosted: Thu Nov 13, 2008 12:47 pm    Post subject: Reply with quote

Novice

Joined: 13 Nov 2008
Posts: 16

Tanks for the reply. But it seems haven't answered my question.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Nov 13, 2008 2:14 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

thomas2004 wrote:
Tanks for the reply. But it seems haven't answered my question.


What were you expecting? We can't know your exact situation, hence my "current depth is affected by a variety of factors".

This is why current depth is so seldom used in an application.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Thu Nov 13, 2008 3:01 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

If what he says is true, I would be surprised that I can get a message out of a queue whose q depth is actually* reporting zero.

* maybe the code that checks the depth is wack
* it takes a millisecond for the q depth to change, another reason doing any MQGETs based on it's value is pointless
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Nov 13, 2008 3:23 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

PeterPotkay wrote:
If what he says is true, I would be surprised that I can get a message out of a queue whose q depth is actually* reporting zero.




PeterPotkay wrote:
* it takes a millisecond for the q depth to change, another reason doing any MQGETs based on it's value is pointless



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
thomas2004
PostPosted: Fri Nov 14, 2008 3:01 am    Post subject: Reply with quote

Novice

Joined: 13 Nov 2008
Posts: 16

I test my program in test enviroment where there is no other program runs. So if I put a message into the queue, this will be there until I hold it. That's the reason I wonder why I can get the true value from the RES-queue and the dlq but not from the PUT-queue.

The option I use is "MQC.MQOO_INQUIRE | MQC.MQOO_BROWSE".
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Fri Nov 14, 2008 3:10 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

are res queue and put queue you use in the program from the same type? although i remember when opening an alias queue for inqure you will get the values of the base queue.....
_________________
Regards, Butcher
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Nov 14, 2008 3:40 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

I hope this is only for testing; inquire and browse don't really belong in production applications (with some exceptions).

You may also prevent use of remote queues with certain options, it's generally a sign a confused thinking if you believe an application (rather than a utility program) needs to do this sort of stuff.
Back to top
View user's profile Send private message
thomas2004
PostPosted: Fri Nov 14, 2008 3:46 am    Post subject: Reply with quote

Novice

Joined: 13 Nov 2008
Posts: 16

zpat wrote:
I hope this is only for testing; inquire and browse don't really belong in production applications (with some exceptions).

You may also prevent use of remote queues with certain options, it's generally a sign a confused thinking if you believe an application (rather than a utility program) needs to do this sort of stuff.


1.
I use this not for production application. I am going to write a monitoring-program which will check the status of the queues. So, the currentdepth of a queue etc. is surely a watched parameter. Isn't it?

2.
Since the MQ-Server and mainframe are not installed in our company but in external provider, so if I connect to the MQ-manager or open queue, it is a remote operation. Is it OK? Or there could be any problem?
Back to top
View user's profile Send private message
thomas2004
PostPosted: Fri Nov 14, 2008 4:00 am    Post subject: Reply with quote

Novice

Joined: 13 Nov 2008
Posts: 16

Mr Butcher wrote:
are res queue and put queue you use in the program from the same type? although i remember when opening an alias queue for inqure you will get the values of the base queue.....


Here is the information of the Request-Queue:
Code:

[ INFO] 12:50:46 massage.monitor.MonitorManagerAndQueue - MQQueue=com.ibm.mq.MQQueue@1df5a8f
[ INFO] 12:50:46 massage.monitor.MonitorManagerAndQueue - MQQueue.CurrentDepth=0
[ INFO] 12:50:46 massage.monitor.MonitorManagerAndQueue - MQQueue.CreationDateTime=Thu Nov 16 11:55:52 CET 2006
[ INFO] 12:50:46 massage.monitor.MonitorManagerAndQueue - MQQueue.DefinitionType=1
[ INFO] 12:50:46 massage.monitor.MonitorManagerAndQueue - MQQueue.Description=MS75 Request Queue                                             
[ INFO] 12:50:46 massage.monitor.MonitorManagerAndQueue - MQQueue.MaximumDepth=999999999
[ INFO] 12:50:47 massage.monitor.MonitorManagerAndQueue - MQQueue.MaximumMessageLength=4194304
[ INFO] 12:50:47 massage.monitor.MonitorManagerAndQueue - MQQueue.OpenInputCount=0
[ INFO] 12:50:47 massage.monitor.MonitorManagerAndQueue - MQQueue.OpenOutputCount=0
[ INFO] 12:50:47 massage.monitor.MonitorManagerAndQueue - MQQueue.QueueType=1
[ INFO] 12:50:47 massage.monitor.MonitorManagerAndQueue - MQQueue.TriggerType=2
[ INFO] 12:50:47 massage.monitor.MonitorManagerAndQueue - MQQueue.Shareability=1
[ INFO] 12:50:47 massage.monitor.MonitorManagerAndQueue - MQQueue.TriggerControl=1
[ INFO] 12:50:47 massage.monitor.MonitorManagerAndQueue - MQQueue.TriggerData=                                                               
[ INFO] 12:50:47 massage.monitor.MonitorManagerAndQueue - MQQueue.TriggerDepth=1


And here is thoese of Respons-Queue:
Code:

[ INFO] 12:52:16 massage.monitor.MonitorManagerAndQueue - MQQueue=com.ibm.mq.MQQueue@1df5a8f
[ INFO] 12:52:16 massage.monitor.MonitorManagerAndQueue - MQQueue.CurrentDepth=1
[ INFO] 12:52:16 massage.monitor.MonitorManagerAndQueue - MQQueue.CreationDateTime=Thu Nov 16 11:55:52 CET 2006
[ INFO] 12:52:16 massage.monitor.MonitorManagerAndQueue - MQQueue.DefinitionType=1
[ INFO] 12:52:16 massage.monitor.MonitorManagerAndQueue - MQQueue.Description=MS75 Response Queue                                             
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.MaximumDepth=999999999
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.MaximumMessageLength=4194304
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.OpenInputCount=0
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.OpenOutputCount=0
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.QueueType=1
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.TriggerType=1
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.Shareability=1
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.TriggerControl=0
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.TriggerData=                                                               
[ INFO] 12:52:17 massage.monitor.MonitorManagerAndQueue - MQQueue.TriggerDepth=1


First I send message to the Request-Queue, then I send message to the Response-Queue. And I use the same option (MQC.MQOO_INQUIRE | MQC.MQOO_BROWSE) to open the queue. But here one can see the currentDepth of the Request-Queue=0, but this of Response_queue=1.

I am sure the message sent to the Request-Queue is inside the queue, since I can really get out a message from there. I wonder why the currentDepth=0 by Request-Queue though there is really a message is inside .
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Nov 14, 2008 5:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

thomas2004 wrote:
1.
I use this not for production application. I am going to write a monitoring-program which will check the status of the queues. So, the currentdepth of a queue etc. is surely a watched parameter. Isn't it?


If these queues are owned by an external provider, why are you monitoring them? What would you do if you discovered a problem? Who would you tell, because anyone with the ability to do something about any problem on the external side would already be monitoring the queues?

thomas2004 wrote:
2.
Since the MQ-Server and mainframe are not installed in our company but in external provider, so if I connect to the MQ-manager or open queue, it is a remote operation. Is it OK? Or there could be any problem?


You are entirely reliant on the set up at the external end, and it's ability to respond to remote enquires and administration. If I owned the external queue manager, you'd have serious problems....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Nov 14, 2008 6:59 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

If you want to write a monitoring program you should look into MS0B and pcf commands.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » A question about getting 'CurrentDepth' from the PUT-Queue
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.