With Oracle's Advanced Queuing is there a way to dequeue messages in a LIFO (last in first out) order? There is an indication through a lack of information that this is not an option, but perhaps there is a way to do this such as queuing in a different order.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Assuming that you are using PL/SQL to dequeue the message (there may be additional JMS limitations-- I don't know enough about the interplay between JMS and AQ), you should be able to use a priority queue to implement LIFO (though it would be a bit hokey). When you enqueue a message, you can specify a priority
If you create a sequence that counts back from some really large number, you could assign an ever increasing priority. Then your prioritized dequeue would get messages in a LIFO order.
To get LIFO behavior in Oracle, you could implement a stack using a PL/SQL object:
Then you would need to wrap your enqueue/dequeue functions so instead of passing through to AQ, they would instead go to your stack rather than the AQ tables.