09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Usage Notes<br />

Search criteria and dequeue order for messages:<br />

Dequeuing a Message<br />

The search criteria for messages to be dequeued is determined by the consumer<br />

<br />

name, msgid and correlation parameters in the dequeue options. Msgid uniquely<br />

identifies the message to be dequeued. Correlation identifiers are<br />

application-defined identifiers that are not interpreted by AQ.<br />

Only messages in the READY state are dequeued unless a msgid is specified.<br />

The dequeue order is determined by the values specified at the time the queue<br />

<br />

table is created unless overridden by the msgid and correlation id in dequeue<br />

options.<br />

The database consistent read mechanism is applicable for queue operations. For<br />

<br />

example, a BROWSE call may not see a message that is enqueued after the<br />

beginning of the browsing transaction.<br />

Navigating through a queue<br />

The default NAVIGATION parameter during dequeue is NEXT MESSAGE. This<br />

means that subsequent dequeues will retrieve the messages from the queue based<br />

on the snapshot obtained in the first dequeue. In particular, a message that is<br />

enqueued after the first dequeue command will be processed only after processing<br />

all the remaining messages in the queue. This is usually sufficient when all the<br />

messages have already been enqueued into the queue, or when the queue does not<br />

have a priority-based ordering. However, applications must use the FIRST<br />

MESSAGE navigation option when the first message in the queue needs to be<br />

processed by every dequeue command. This usually becomes necessary when a<br />

higher priority message arrives in the queue while messages already-enqueued are<br />

being processed.<br />

Note: It may also be more efficient to use the FIRST MESSAGE<br />

navigation option when there are messages being concurrently<br />

enqueued. If the FIRST MESSAGE option is not specified, AQ will<br />

have to continually generate the snapshot as of the first dequeue<br />

command, leading to poor performance. If the FIRST MESSAGE<br />

option is specified, AQ will use a new snapshot for every dequeue<br />

command.<br />

Operational Interface: Basic Operations 11-45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!