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.

Dequeuing a Message<br />

Dequeue by Message Grouping<br />

Messages enqueued in the same transaction into a queue that has been enabled<br />

<br />

for message grouping will form a group. If only one message is enqueued in the<br />

transaction, this will effectively form a group of one message. There is no upper<br />

limit to the number of messages that can be grouped in a single transaction.<br />

In queues that have not been enabled for message grouping, a dequeue in<br />

<br />

LOCKED or REMOVE mode locks only a single message. By contrast, a dequeue<br />

operation that seeks to dequeue a message that is part of a group will lock the<br />

entire group. This is useful when all the messages in a group need to be<br />

processed as an atomic unit.<br />

When all the messages in a group have been dequeued, the dequeue returns an<br />

<br />

error indicating that all messages in the group have been processed. The<br />

application can then use the NEXT TRANSACTION to start dequeuing messages<br />

from the next available group. In the event that no groups are available, the<br />

dequeue will time-out after the specified WAIT period.<br />

Syntax<br />

See Chapter 3, "AQ Programmatic Environments" for a list of available functions in<br />

each programmatic environment. Use the following syntax references for each<br />

programmatic environment:<br />

PL/SQL (DBMS_AQ Package): <strong>Oracle</strong>9i Supplied PL/SQL Packages and Types Reference<br />

<br />

DBMS_AQ, DEQUEUE procedure<br />

Visual Basic (OO4O) (<strong>Oracle</strong> Objects for OLE (OO4O) Online Help): From Help<br />

<br />

Topics, Contents tab, select OO4O Automation Server > OBJECTS > OraAQ<br />

Java (JDBC): <strong>Oracle</strong>9i Supplied Java Packages Reference,oracle.jms,<br />

<br />

AQ<strong>Oracle</strong>Queue.dequeue<br />

Examples<br />

See Chapter 3, "AQ Programmatic Environments" for a list of available functions in<br />

each programmatic environment. Examples in the following programmatic<br />

environments are provided:<br />

PL/SQL (DBMS_AQ Package): Dequeue of Object Type Messages on page 11-49<br />

Java (JDBC): Dequeue a message from a single-consumer queue (specify<br />

<br />

options) on page 11-49<br />

Visual Basic (OO4O): Dequeue a message on page 11-50<br />

11-46 <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!