Author |
Message
|
michelz |
Posted: Tue Aug 06, 2002 3:57 am Post subject: Browse Message |
|
|
Novice
Joined: 05 Feb 2002 Posts: 10 Location: Michel Zohar
|
How can i browse a message in a specific position? |
|
Back to top |
|
 |
bob_buxton |
Posted: Tue Aug 06, 2002 4:09 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
What do you mean by 'a specific position'?
You can supply message id, correlid and/or group id and the appropriate MQMO_MATCH_xxx options to specify the criteria used to locate messages.
But if you want to find the 21st message on the queue I don't think you can without a get-next loop
Bob _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
michelz |
Posted: Tue Aug 06, 2002 4:49 am Post subject: |
|
|
Novice
Joined: 05 Feb 2002 Posts: 10 Location: Michel Zohar
|
I need to implement paging on the messages, suppose i need messages from 1500 to 1550!
It will be vary bad to browse next messages until the required messages.
Thanks |
|
Back to top |
|
 |
bduncan |
Posted: Tue Aug 06, 2002 5:10 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
The whole concept of a queue is FIFO. You simply cannot get around the inherent structure of the queue. Even if an API programmatically allows you to specify message # X, it will still need to do a linear traversal across X-1 positions before arriving at the desired message. The same thing applies when you try to get a message based on CorrelId or some other matching parameter. The queue manager must position the cursor at the front of the queue and begin a linear traversal until reaching the desired message. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
nimconsult |
Posted: Tue Aug 06, 2002 10:43 pm Post subject: |
|
|
 Master
Joined: 22 May 2002 Posts: 268 Location: NIMCONSULT - Belgium
|
Michel,
A usual browsing technique consist in keeping a key of the last item of the list. When a "page down" is requested, position on the key and browse onward.
For MQ you could keep the message id (assuming there is one) to reposition yourself in the queue. _________________ Nicolas Maréchal
Senior Architect - Partner
NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be |
|
Back to top |
|
 |
bob_buxton |
Posted: Tue Aug 06, 2002 11:46 pm Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
MQ can and does maintain a browse cursor for sequential browsing of the queue. But the queue is (normaly) a very dynamic thing with messages being added and removed all the time.
So it normally does not make sense to ask for messages 1500-1550 on a queue. What was message 1550 may become message 1 in the queue so MQ does not provide the facility to request messages by ordinal number.
Instead it provides the facilities to search for specific message id and correlids etc. If you know you will doing a lot of searches for specific messages you can index the queue to improve search performance.
I still do not understand why you thnk you need to find a message by position.
Bob _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
|