Dequeue condition causes Queue Sort Order to be ignored
jimdFeb 1 2012 — edited Feb 2 2012This question relates to the fact that when a dequeue condition is specified the sort order of the queue cannot be relied on:
From the 11.2 document "Introduction to Oracle AQ":
"A dequeue condition is expressed in terms of message properties or message content and is similar in syntax to the WHERE clause of a SQL query. Messages in the queue are evaluated against the condition, and messages that satisfy the given condition are returned. When a dequeue condition is used, the order of the messages dequeued is indeterminate, and the sort order of the queue is not honored."
This causes me a problem - I'm interested in consumers selecting data that satisfies a certain criteria, but want them to get this qualifying data in order of oldest first (ENQ_TIME). If by specifying the dequeue condition means that the order is unpredictable then this is not acceptable.
I recognise that I could solve the problem by using MULTIPLE_CONSUMER queue in which subscriptions are added with rules for each possible consumer. The problem with this is that the volatility of the consumer pool is relatively high and a solution is sought that does not necessitate adjustment of the queue properties.
Am I missing something? i.e. misinterpretting this restriction?
Has anybody else faced this challenge and found a technique to solve this problem?
thanks in anticipation.