Author |
Message
|
IanB |
Posted: Fri Oct 20, 2006 2:29 am Post subject: Can I peek at a message on a queue? |
|
|
Apprentice
Joined: 13 Oct 2006 Posts: 43
|
Is it possible to read a message from a queue without removing it from the queue? I know through the admin utility you can view messages on a queue and view them, so it must be possible, but I recall reading something in the last week that puts that in doubt from an api perspective.
Edit: Thinking about it, can I access them out of sequence or is it always lifo/fifo (I don't even know that)...
We're using V5.3 btw
Cheers
Ian
Last edited by IanB on Fri Oct 20, 2006 2:33 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 20, 2006 2:33 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You mean like the BROWSE functionality offered by the API, that sort of thing?
What did you read and where? I'd have gone with the Application Programming Guide section titled "Browsing messages from a queue" myself.  _________________ Honesty is the best policy.
Insanity is the best defence.
Last edited by Vitor on Fri Oct 20, 2006 2:37 am; edited 1 time in total |
|
Back to top |
|
 |
IanB |
Posted: Fri Oct 20, 2006 2:35 am Post subject: |
|
|
Apprentice
Joined: 13 Oct 2006 Posts: 43
|
Vitor wrote: |
You mean like the BROWSE functionality offered by the API, that sort of thing?
What did you read and where? |
Not sure, I've been reading so much MQ stuff over the last week it all sort of blurs into one I'll investigate browse, I assumed (as you do) it would be called peek but you search for peek and you just get 30 articles called "IBM peek into new websphere" and so on
Thanks for such a quick response, you're a star  |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 20, 2006 2:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
There are a number of industry standard jokes about assumptions that I won't bother to repeat here.
It's not a separate function, it's an option, which I don't think I made completely clear. Again when writing code:
The Application Programming Guide Is Your Friend _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
IanB |
Posted: Fri Oct 20, 2006 2:40 am Post subject: |
|
|
Apprentice
Joined: 13 Oct 2006 Posts: 43
|
Just stumbled over this:
A load of MQ resources
Haven't dug too deep yet, but looks like an interesting resource  |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 20, 2006 2:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
IanB wrote: |
Just stumbled over this:
A load of MQ resources
Haven't dug too deep yet, but looks like an interesting resource  |
Stumbled over it? So much for Roger L sponsoring a section in this forum!
Capitalware are also producing a series of really good tools and products (opinion not endorsement). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Nigelg |
Posted: Fri Oct 20, 2006 3:16 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Quote: |
The Application Programming Guide Is Your Friend
|
The Application Programming Reference is a better friend. _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 20, 2006 3:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Nigelg wrote: |
Quote: |
The Application Programming Guide Is Your Friend
|
The Application Programming Reference is a better friend. |
In the early stages, and I think from previous posts it's not unkind to say that IanB is in the early stages of his MQ, the guide is a better starting point.
Once you've mastered the basics & found your stride I agree entirely that the Reference is the more useful publication. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 20, 2006 3:25 am Post subject: Re: Can I peek at a message on a queue? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
IanB wrote: |
Edit: Thinking about it, can I access them out of sequence or is it always lifo/fifo (I don't even know that)...
|
Message sequence is a queue property that can't be varied by an application. MQ doesn't support lifo, is by default fifo but is commonly set to use message priority sequence. IIRC delivery is fifo within priority but I'm not certain if that's a product feature, just what normally happens or just what I think I've seen happening.
Exercise for the student there  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
IanB |
Posted: Fri Oct 20, 2006 3:39 am Post subject: Re: Can I peek at a message on a queue? |
|
|
Apprentice
Joined: 13 Oct 2006 Posts: 43
|
Yep still a total noob, and I eschewed the normal baby steps for a head
first full on charge down hill screaming "GAARRR" all the way
Apologies to Roger L I hadn't realised, but the site looks good! I'll have to have a poke at your tools when I get a moment.
I think I'll take a leisurely browse through The Application Programming Guide now I've got a bit more time.
Thanks again all. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 20, 2006 3:51 am Post subject: Re: Can I peek at a message on a queue? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
IanB wrote: |
Yep still a total noob, and I eschewed the normal baby steps for a head
first full on charge down hill screaming "GAARRR" all the way
|
No offence was intended nor was there any intended implication that your current state would persist.
The head first, full on charge is a viable strategy - though the level of success and/or pain does vary with the size of the subject you're attacking...  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
wschutz |
Posted: Fri Oct 20, 2006 3:58 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Quote: |
IIRC delivery is fifo within priority but I'm not certain if that's a product feature, just what normally happens or just what I think I've seen happening.
|
close.... it's based on the setting of MSGDLVSQ at the time of the PUT operation...either MSGDLVSQ(PRIORITY) or MSGDLVSQ(FIFO) _________________ -wayne |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 20, 2006 4:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I took my own advice and RTFM'd
From the Command Reference:
Quote: |
MSGDLVSQ Message delivery sequence.
This parameter is supported only on local and model queues.
PRIORITY Messages are delivered (in response to MQGET API calls) in first-in-first-out (FIFO) order within priority.
FIFO Messages are delivered (in response to MQGET API calls) in FIFO order. Priority is ignored for messages on this queue.
|
So it is a documented feature / behaviour. At least I remembered it did it this way, even if I wasn't sure why....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 20, 2006 5:20 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Assuming one has a list of message ids or correlation ids - one can access the queue in any order one wants. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|