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 » MQQueue.getCurrentDepth()

Post new topic  Reply to topic
 MQQueue.getCurrentDepth() « View previous topic :: View next topic » 
Author Message
pazhanikumart
PostPosted: Thu Oct 04, 2001 5:08 am    Post subject: Reply with quote

Apprentice

Joined: 12 Aug 2001
Posts: 32
Location: Chennai,India

Hai all

I am accessing a queue by setting up an condition to match the corell id of the message in the server.Now if i am going to use the MQQueue.getCurrentDepth() method ,will it give the total number of messages in the queue irrespective of the condition or would it give the number of messages that actually matches the given condition ?

Please explain



Palanikumar

_________________
In the end everything is Right ,If it's not then it's not the end

[ This Message was edited by: pazhanikumart on 2001-10-04 06:09 ]
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
kolban
PostPosted: Thu Oct 04, 2001 6:37 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

It will return the number of messages on the queue (any type, any msgid, any correlid). The MQQueue objects models a queue. The selection of messages by msgid or correlid is only performed on an actual get() method call.
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Oct 04, 2001 6:44 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

The getCurentDepth will return the current depth of all of the messages on the queue. MQSeries won't go through the list of messages on the queue to count the ones that match your criteria.

There are also some other things to watch for when looking at the curdepth:

Messages that are inside of a unit of work are counted. You can do an MQPUT to increase the count by 1 and still not be able to get a message until the UOW is committed.

The depth also counts messages that have expired but that have not been discarded yet.

There are details in the Application Programming Reference that you might want to take a look at.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
bduncan
PostPosted: Thu Oct 04, 2001 10:45 am    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

If you really want to find the number of messages that match a particular msgid/correlid combination, then you just need to do MQGETs with browse specified, as well as the parameters you are matching against. Simply count the number of times the MQGET returns something, and you have the number you are looking for. However, this could be an intensive procedure depending on the number of messages in the queue...


_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
pazhanikumart
PostPosted: Fri Oct 05, 2001 10:03 pm    Post subject: Reply with quote

Apprentice

Joined: 12 Aug 2001
Posts: 32
Location: Chennai,India

Hai
Since the queue would contain a large number of messages that satisfies the same criteria ,Issuing a MQBrowse to count the number of messages that satifies and then issuing MQGet, I think,Would cause a performance hit .Is there any way to come around this problem?



Palanikumar

_________________
In the end everything is Right ,If it's not then it's not the end
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
RogerLacroix
PostPosted: Sat Oct 06, 2001 9:40 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
Location: London, ON Canada

Sure there is another approach. Just process the messages and don't bother counting them ahead of time.

Set your correlation Id then just do your get in a while loop. i.e. while(reasonCode==0)

later
Roger...


[ This Message was edited by: RogerLacroix on 2001-10-06 22:52 ]
Back to top
View user's profile Send private message Visit poster's website
pazhanikumart
PostPosted: Tue Oct 16, 2001 3:56 am    Post subject: Reply with quote

Apprentice

Joined: 12 Aug 2001
Posts: 32
Location: Chennai,India

Thanks Roger

Now it works fine



_________________
In the end everything is Right ,If it's not then it's not the end

[ This Message was edited by: pazhanikumart on 2001-10-16 04:57 ]
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQQueue.getCurrentDepth()
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.