Author |
Message
|
dexgk007 |
Posted: Wed Jul 01, 2009 12:44 am Post subject: Extract message(s) from queue based on positions range |
|
|
Newbie
Joined: 14 Apr 2009 Posts: 4
|
Hi All,
I'm developing a tool where a functionnality would consist in extracting from a queue messages based on their positions. As you can see in the WMQ Explorer, messages are displayed with a position number. Is it possible to access directly this position data (e.g. if a queue contains 10000 msgs and you want to extract msgs 9500 to 9550). I want to avoid the browsing of all previous messages present in the queue and I want to go directly to message "n° 9500". Is it possible ? |
|
Back to top |
|
 |
exerk |
Posted: Wed Jul 01, 2009 12:54 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
What happens if the position changes? How are you intending to handle that? _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Wed Jul 01, 2009 1:31 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
a queue is not a database. what you are trying to archive is not possible.
there is limited "direct" access in MQseries to messages.
read about the get options (filling msgid, corelid), read also about index on queue.
in addition, why are you developing tools that already exist (e.g. MO71 will display a range of messages). _________________ Regards, Butcher |
|
Back to top |
|
 |
exerk |
Posted: Wed Jul 01, 2009 1:35 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Mr Butcher wrote: |
...in addition, why are to developing tools that already exist (e.g. MO71 will display a range of messages). |
Because it's always fun to reinvent the wheel...  _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 01, 2009 2:58 am Post subject: Re: Extract message(s) from queue based on positions range |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dexgk007 wrote: |
Is it possible ? |
No, and it's both silly (as previous posters have commented) and dangerous (as previous posters have commented).
Say you decide (by some means that doesn't involve browsing!) that you want to extract messages 9500 to 9550. Firstly you should be slightly concerned that you've over 9000 messages sitting on a queue. You then use this tool to extract the 50 messages you want. You then discover than 10 messages with a higher priority have been placed on the queue, and message 9000 isn't what it was when you examined the queue.
Or worse still you don't discover this, and process the 50 messages extracted as if they're the 50 messages you think they are.
What on earth is the requirement here? What possible use is this sort of thing? Unless of course you are trying to use the queue as a database as my most worthy associate has suggested. This, as he says, is a bad thing to do. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Jul 01, 2009 9:22 pm Post subject: Re: Extract message(s) from queue based on positions range |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
dexgk007 wrote: |
Hi All,
I'm developing a tool where a functionnality would consist in extracting from a queue messages based on their positions. As you can see in the WMQ Explorer, messages are displayed with a position number. Is it possible to access directly this position data (e.g. if a queue contains 10000 msgs and you want to extract msgs 9500 to 9550). I want to avoid the browsing of all previous messages present in the queue and I want to go directly to message "n° 9500". Is it possible ? |
No. MQ only provides browse-first and browse-next options.
A tool like this would be ok if there was nothing else putting or getting on the queue at the time (ie. the contents was static), but as has been pointed out, it does not have any useful meaning when the queue depth is going up and down all the time. There are existing tools that allow access to ranges of messages but they all use the browse-first browse-next method. _________________ Glenn |
|
Back to top |
|
 |
|