Oracle8i Supplied PL/SQL Packages Reference Release 2 (8.1.6) Part Number A76936-01 |
|
The DBMS_AQ
package provides an interface to Oracle's Advanced Queuing.
See Also:
Oracle8i Application Developer's Guide - Advanced Queuing contains detailed information about |
Java interfaces are available for DBMS_AQ
and DBMS_AQADM
. The java interfaces are provided in the $ORACLE_HOME/rdbms/jlib/aqapi
.jar
. In this release, these Java API are available only for queues with RAW
type payloads. Users are required to have EXECUTE
privileges on the DBMS_AQIN
package to use these interfaces.
When using enumerated constants such as BROWSE
, LOCKED
, or REMOVE
, the PL/SQL constants must be specified with the scope of the packages defining it. All types associated with the operational interfaces have to be prepended with DBMS_AQ
. For example:
DBMS_AQ.BROWSE
The following data structures are used in both DBMS_AQ
and DBMS_AQADM
:
This names database objects. This naming convention applies to queues, queue tables, agent names, and object types.
object_name := VARCHAR2; object_name := [<schema_name>.]<name>;
Names for objects are specified by an optional schema name and a name. If the schema name is not specified, then the current schema is assumed. The name must follow object name guidelines in the Oracle8i SQL Reference with regard to reserved characters. The schema name, agent name, and the object type name can each be up to 30 bytes long. However, queue names and queue table names have a maximum of 24 bytes.
This defines queue types.
type_name := VARCHAR2; type_name := <object_type> | "RAW";
Parameter | Description |
---|---|
<object_types> |
Maximum number of attributes in the object type is limited to 900. See Also: Oracle8i Concepts |
"RAW" |
To store payload of type
Because |
This identifies a producer or a consumer of a message.
TYPE sys.aq$_agent IS OBJECT ( name VARCHAR2(30), address VARCHAR2(1024), protocol NUMBER);
Parameter | Description |
---|---|
name |
Name of a producer or consumer of a message. The name must follow object name guidelines in the Oracle8i SQL Reference with regard to reserved characters. |
address |
Protocol-specific address of the recipient. If the protocol is 0 (default), then the address is of the form [ |
protocol |
Protocol to interpret the address and propagate the message. The default is 0. |
This specifies the options available for the enqueue operation.
TYPE enqueue_options_t IS RECORD ( visibility BINARY_INTEGER DEFAULT ON_COMMIT, relative_msgid RAW(16) DEFAULT NULL, sequence_deviation BINARY_INTEGER DEFAULT NULL);
This specifies the options available for the dequeue operation.
TYPE dequeue_options_t IS RECORD ( consumer_name VARCHAR2(30) DEFAULT NULL, dequeue_mode BINARY_INTEGER DEFAULT REMOVE, navigation BINARY_INTEGER DEFAULT NEXT_MESSAGE, visibility BINARY_INTEGER DEFAULT ON_COMMIT, wait BINARY_INTEGER DEFAULT FOREVER, msgid RAW(16) DEFAULT NULL, correlation VARCHAR2(128) DEFAULT NULL);
This describes the information that is used by AQ to manage individual messages. These are set at enqueue time, and their values are returned at dequeue time.
TYPE message_properties_t IS RECORD ( priority BINARY_INTEGER DEFAULT 1, delay BINARY_INTEGER DEFAULT NO_DELAY, expiration BINARY_INTEGER DEFAULT NEVER, correlation VARCHAR2(128) DEFAULT NULL, attempts BINARY_INTEGER, recipient_list aq$_recipient_list_t, exception_queue VARCHAR2(51) DEFAULT NULL, enqueue_time DATE, state BINARY_INTEGER, sender_id aq$_agent DEFAULT NULL, original_msgid RAW(16) DEFAULT NULL); TYPE aq$_recipient_list_t IS TABLE OF sys.aq$_agent INDEX BY BINARY_INTEGER;
Parameter | Description |
---|---|
|
Specifies/returns the priority of the message. A smaller number indicates higher priority. The priority can be any number, including negative numbers. |
|
Specifies/returns the delay of the enqueued message. The delay represents the number of seconds after which a message is available for dequeuing. Dequeuing by msgid overrides the delay specification. A message enqueued with delay set will be in the
number: the number of seconds to delay the message. |
|
Specifies/returns the expiration of the message. It determines, in seconds, the duration the message is available for dequeuing. This parameter is an offset from the delay. Expiration processing requires the queue monitor to be running.
number: number of seconds message remains in |
|
Returns the identification supplied by the producer for a message at enqueuing. |
|
Returns the number of attempts that have been made to dequeue this message. This parameter cannot be set at enqueue time. |
|
For type definition, see the "Agent". This parameter is only valid for queues which allow multiple consumers. The default recipients are the queue subscribers. This parameter is not returned to a consumer at dequeue time. |
|
Specifies/returns the name of the queue to which the message is moved if it cannot be processed successfully. Messages are moved in two cases: The number of unsuccessful dequeue attempts has exceeded max_retries or the message has expired. All messages in the exception queue are in the
The default is the exception queue associated with the queue table. If the exception queue specified does not exist at the time of the move, then the message is moved to the default exception queue associated with the queue table, and a warning is logged in the alert file. If the default exception queue is used, then the parameter returns a |
|
Returns the time the message was enqueued. This value is determined by the system and cannot be set by the user. This parameter can not be set at enqueue time. |
|
Returns the state of the message at the time of the dequeue. This parameter can not be set at enqueue time.
|
|
Specifies/returns the application-specified sender identification.
|
|
This parameter is used by Oracle AQ for propagating messages.
|
This identifies the list of agents that will receive the message. This structure is used only when the queue is enabled for multiple dequeues.
TYPE aq$_recipient_list_t IS TABLE OF sys.aq$_agent INDEX BY BINARY_INTEGER;
This identifies the list of agents for DBMS_AQ
.LISTEN
to listen for.
TYPE aq$_agent_list_t IS TABLE of sys.aq$_agent INDEX BY BINARY INTEGER;
This identifies the list of subscribers that subscribe to this queue.
TYPE aq$_subscriber_list_t IS TABLE OF sys.aq$_agent INDEX BY BINARY_INTEGER;
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|