Advanced Queuing

Dequeue Options

Note

This object is an extension to the DB API. It is returned by the Connection.deqoptions() call and is used in calls to Connection.deq().

DeqOptions.condition

This attribute specifies a boolean expression similar to the where clause of a SQL query. The boolean expression can include conditions on message properties, user data properties and PL/SQL or SQL functions. The default is to have no condition specified.

DeqOptions.consumername

This attribute specifies the name of the consumer. Only messages matching the consumer name will be accessed. If the queue is not set up for multiple consumers this attribute should not be set. The default is to have no consumer name specified.

DeqOptions.correlation

This attribute specifies the correlation identifier of the message to be dequeued. Special pattern-matching characters, such as the percent sign (%) and the underscore (_), can be used. If multiple messages satisfy the pattern, the order of dequeuing is indeterminate. The default is to have no correlation specified.

DeqOptions.deliverymode

This write-only attribute specifies what types of messages should be dequeued. It should be one of the values MSG_PERSISTENT (default), MSG_BUFFERED or MSG_PERSISTENT_OR_BUFFERED.

DeqOptions.mode

This attribute specifies the locking behaviour associated with the dequeue operation. It should be one of the values DEQ_BROWSE, DEQ_LOCKED, DEQ_REMOVE (default), or DEQ_REMOVE_NODATA.

DeqOptions.msgid

This attribute specifies the identifier of the message to be dequeued. The default is to have no message identifier specified.

DeqOptions.navigation

This attribute specifies the position of the message that is retrieved. It should be one of the values DEQ_FIRST_MSG, DEQ_NEXT_MSG (default), or DEQ_NEXT_TRANSACTION.

DeqOptions.transformation

This attribute specifies the name of the transformation that must be applied after the message is dequeued from the database but before it is returned to the calling application. The transformation must be created using dbms_transform. The default is to have no transformation specified.

DeqOptions.visibility

This attribute specifies the transactional behavior of the dequeue request. It should be one of the values DEQ_ON_COMMIT (default) or DEQ_IMMEDIATE. This attribute is ignored when using the DEQ_BROWSE mode. Note the value of autocommit is always ignored.

DeqOptions.wait

This attribute specifies the time to wait, in seconds, for a message matching the search criteria to become available for dequeuing. One of the values DEQ_NO_WAIT or DEQ_WAIT_FOREVER can also be used. The default is DEQ_WAIT_FOREVER.

Enqueue Options

Note

This object is an extension to the DB API. It is returned by the Connection.enqoptions() call and is used in calls to Connection.enq().

EnqOptions.deliverymode

This write-only attribute specifies what type of messages should be enqueued. It should be one of the values MSG_PERSISTENT (default) or MSG_BUFFERED.

EnqOptions.transformation

This attribute specifies the name of the transformation that must be applied before the message is enqueued into the database. The transformation must be created using dbms_transform. The default is to have no transformation specified.

EnqOptions.visibility

This attribute specifies the transactional behavior of the enqueue request. It should be one of the values ENQ_ON_COMMIT (default) or ENQ_IMMEDIATE. Note the value of autocommit is ignored.

Message Properties

Note

This object is an extension to the DB API. It is returned by the Connection.msgproperties() call and is used in calls to Connection.deq() and Connection.enq().

MessageProperties.attempts

This read-only attribute specifies the number of attempts that have been made to dequeue the message.

MessageProperties.correlation

This attribute specifies the correlation used when the message was enqueued.

MessageProperties.delay

This attribute specifies the number of seconds to delay an enqueued message. Any integer is acceptable but the constant MSG_NO_DELAY can also be used indicating that the message is available for immediate dequeuing.

MessageProperties.deliverymode

This read-only attribute specifies the type of message that was dequeued. It will be one of the values MSG_PERSISTENT or MSG_BUFFERED.

MessageProperties.enqtime

This read-only attribute specifies the time that the message was enqueued.

MessageProperties.exceptionq

This attribute specifies the name of the queue to which the message is moved if it cannot be processed successfully. Messages are moved if the number of unsuccessful dequeue attempts has exceeded the maximum number of retries or if the message has expired. All messages in the exception queue are in the MSG_EXPIRED state. The default value is the name of the exception queue associated with the queue table.

MessageProperties.expiration

This attribute specifies, in seconds, how long the message is available for dequeuing. This attribute is an offset from the delay attribute. Expiration processing requires the queue monitor to be running. Any integer is accepted but the constant MSG_NO_EXPIRATION can also be used indicating that the message never expires.

MessageProperties.msgid

This attribute specifies the id of the message in the last queue that generated this message.

MessageProperties.priority

This attribute specifies the priority of the message. A smaller number indicates a higher priority. The priority can be any integer, including negative numbers. The default value is zero.

MessageProperties.state

This read-only attribute specifies the state of the message at the time of the dequeue. It will be one of the values MSG_WAITING, MSG_READY, MSG_PROCESSED or MSG_EXPIRED.