|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to get newest message in queue? |
« View previous topic :: View next topic » |
Author |
Message
|
rgross999 |
Posted: Thu Jan 15, 2004 1:30 pm Post subject: How to get newest message in queue? |
|
|
Newbie
Joined: 15 Jan 2004 Posts: 8
|
Can someone tell me how to get the most recent message in a queue opened for browsing?
The problem is this: when a queue receives a message I want to extract data from the message but leave the message on the queue. The queue has a trigger which causes the data extraction program to be run.
In the extraction program I know how to read the first, ie the oldest message. I also know how to read all the messages.
But I cannot figure out how to read just the newest message.
Is it necessary to read ALL of the messages in the queue to get to the most recent one? How can we tell that the message is the last in the queue?
Is there any simple way of getting (browsing) only the message that caused the trigger to fire?
Thanks in advance. |
|
Back to top |
|
 |
EddieA |
Posted: Thu Jan 15, 2004 2:04 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
Can someone tell me how to get the most recent message in a queue opened for browsing? |
Browse each message, then save the data and HDR in a 2nd buffer. When you get the 2033 warning, the saved buffer will have the most recent message. Or do an INQ to get the queue depth, but you'll still have to browse each one to 'skip' it. Both these assume that the queue is set with message sequence FIFO, or all the messages are the same priority, or else all bets are off.
Quote: |
The queue has a trigger which causes the data extraction program to be run. |
In which case after your browse program has run, this queue will never get triggered again, unless you have another process removing the messages.
Quote: |
In the extraction program I know how to read the first, ie the oldest message |
Not if priority messages are involved.
Quote: |
Is it necessary to read ALL of the messages in the queue to get to the most recent one? |
Yes.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|