Author |
Message
|
pazhanikumart |
Posted: Thu Oct 04, 2001 5:08 am Post subject: |
|
|
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 |
|
 |
kolban |
Posted: Thu Oct 04, 2001 6:37 am Post subject: |
|
|
 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 |
|
 |
bower5932 |
Posted: Thu Oct 04, 2001 6:44 am Post subject: |
|
|
 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 |
|
 |
bduncan |
Posted: Thu Oct 04, 2001 10:45 am Post subject: |
|
|
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 |
|
 |
pazhanikumart |
Posted: Fri Oct 05, 2001 10:03 pm Post subject: |
|
|
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 |
|
 |
RogerLacroix |
Posted: Sat Oct 06, 2001 9:40 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 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 |
|
 |
pazhanikumart |
Posted: Tue Oct 16, 2001 3:56 am Post subject: |
|
|
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 |
|
 |
|