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.

Dequeue Features<br />

For messages intended for multiple recipients, each message keeps a separate<br />

retry count for each recipient. The message is moved to the exception queue<br />

only when retry counts for all recipients of the message have exceeded the<br />

specified retry limit. The default retry limit is 5 for single-consumer queues and<br />

8.1-compatible multiconsumer queues. No retry limit is not supported for 8.0-<br />

compatible multiconsumer queues.<br />

The statement executed by the client contains a dequeue that succeeded but the<br />

<br />

statement itself was undone later due to an exception. To understand this case,<br />

consider a PL/SQL procedure that contains a call to DBMS_AQ.DEQUEUE. If the<br />

dequeue procedure succeeds but the PL/SQL procedure raises an exception,<br />

AQ will attempt to increment the RETRY_COUNT of the message returned by the<br />

dequeue procedure.<br />

The client program successfully dequeued a message but terminated before<br />

<br />

committing the transaction.<br />

Messages intended for 8.1-compatible multiconsumer queues cannot be dequeued<br />

by the intended recipients once the messages have been moved to an exception<br />

queue. These messages should instead be dequeued in the REMOVE or BROWSE<br />

mode exactly once by specifying a NULL consumer name in the dequeue options.<br />

The messages can also be dequeued by their message IDs.<br />

Messages intended for single consumer queues, or for 8.0-compatible<br />

multiconsumer queues, can only be dequeued by their message IDs once the<br />

messages have been moved to an exception queue.<br />

Users can associate a RETRY_DELAY with a queue. The default value for this<br />

parameter is 0, meaning that the message will be available for dequeue immediately<br />

after the RETRY_COUNT is incremented. Otherwise the message will be unavailable<br />

for RETRY_DELAY seconds. After RETRY_DELAY seconds, the queue monitor marks<br />

the message as READY.<br />

For a multiconsumer queue, RETRY_DELAY is for each subscriber.<br />

Scenario<br />

In the BooksOnLine application, the business rule for each shipping region is that<br />

an order will be placed in a back order queue if the order cannot be filled<br />

immediately. The back order application will try to fill the order once a day. If the<br />

order cannot be filled within 5 days, it is placed in an exception queue for special<br />

processing. You can implement this process by making use of the retry and<br />

exception handling features in AQ.<br />

8-82 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

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

Saved successfully!

Ooh no, something went wrong!