Previous | Table of Contents | Next |
This procedure allows changes to be made to max_retries, retry_delay, and retention_time for the specified queue. The changes go into effect immediately if auto_commit is set to TRUE, and when the transaction commits if its set to FALSE. See CREATE_QUEUE for more information on these alterable parameters.
PROCEDURE ADD_SUBSCRIBER( queue_name IN VARCHAR2, subscriber IN SYS.AQ$_AGENT);
This is used to add a subscriber to queues that are enabled for multiple consumers. The new subscriber becomes the default subscriber.
PROCEDURE REMOVE_SUBSCRIBER( queue_name IN VARCHAR2, subscriber IN SYS.AQ$_AGENT);
Removes the specified subscriber from the queue along with all references to the subscriber in messages in the queue.
FUNCTION QUEUE_SUBSCRIBERS( queue_name IN VARCHAR2) RETURN AQ$_SUBSCRIBER_LIST_T;
This function is used to retrieve a PL/SQL table of the subscribers for a queue.
PROCEDURE GRANT_TYPE_ACCESS( user_name IN VARCHAR2);
This grants privileges to the object types created for use with advanced queuing to the specified user. To perform the administrative procedures CREATE_QUEUE_TABLE, CREATE_QUEUE, ADD_SUBSCRIBER, and REMOVE_SUBSCRIBER, users must have access to these types.
PROCEDURE START_TIME_MANAGER; PROCEDURE STOP_TIME_MANAGER;
These procedures start and stop activities performed by the time manager process. The Time Manager is started at database startup by setting AQ_TM_PROCESS=1 in the init.ora.
DBMS_AQ
Users must be granted AQ_USER_ROLE in order to use the ENQUEUE and DEQUEUE procedures. Rights also must be granted for use of the object types used for queues, queue tables, and subscribers. To grant use of these object types, DBMS_AQADM.GRANT_TYPE_ACCESS must be run by SYS for each user.
Several types are implemented for use with DBMS_AQ. They are either PL/SQL records or index-by tables. They are as follows:
TYPE SYS.AQ$_AGENT IS RECORD( name VARCHAR2(30), address VARCHAR(30), protocol NUMBER);
This PL/SQL record identifies a receiving or producing agent for a queue. Oracle 8.0.3 does not make use of address and protocol. These fields are for future enhancements.
TYPE AQ$_RECIPIENT_LIST_T IS TABLE OF SYS.AQ$_AGENT INDEX BY BINARY_INTEGER;
The AQ$_RECIPIENT_LIST_T type is an index-by table of SYS.AQ$_AGENT and is used to store a list of receiving agents in a message.
TYPE MESSAGE_PROPERTIES_T IS RECORD( priority BINARY INTEGER default 1, delay BINARY_INTEGER default NO_DELAY, expiration BINARY_INTEGER default NEVER, correlation VARCHAR(128) default NULL, attempts BINARY_INTEGER, recipient_list AQ$_RECIPIENT_LIST_T, exception_queue VARCHAR2(51) default NULL, enqueue_time DATE, state BINARY_INTEGER);
priority | Set enqueuing priority. Lower numbers are higher priority. Any integer, including negatives, is permissible. |
delay | Delay, in seconds, before enqueing or dequeing. |
expiration | Time before message is moved to the exception queue if it is not dequeued. |
correlation | Groups of messages can be referenced using this identifier. |
attempts | Used in dequeuing to specify how many attempts to dequeue should be made. |
recipient_list | Contains a list of agents to receive a message. Used for enqueuing. |
exception_queue | Specifies the exception queue to use in case of expiration or failure to dequeue. The default exception queue for the queue table is used if this is not set. |
enqueue_time | Set automatically at enqueue and returned by DEQUEUE. |
state | Returned by DEQUEUE. Set and updated automatically. Possible values are WAITING, READY, PROCESSED, and EXPIRED. |
This type is used in ENQUEUE and DEQUEUE and specifies the options for a given message.
TYPE ENQUEUE_OPTIONS_T IS RECORD( visibility BINARY_INTEGER default ON_COMMIT, relative_msgid RAW(16) default NULL, sequence_deviation BINARY_INTEGER default NULL);
visibility | ON_COMMIT for synchronous and IMMEDIATE for asynchronous. |
relative_msgid | Identifies a message for sequence_deviation. |
sequence_deviation | BEFORE inserts the message just before the message specified by relative_msgid. TOP puts the message at the top of the queue. NULL lets the priority determine queue position. |
Used to set options for enqueuing.
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(30) default NULL);
consumer_name | Consumer for whom messages may be dequeued. |
dequeue_mode | BROWSE returns the message without removing it or locking it. LOCKED reads the message and locks it from writing. REMOVE reads it and deletes or moves it. |
navigation | NEXT_MESSAGE returns the next message according to the consumer_name, msgid, and correlation settings. NEXT_TRANSACTION gets the first message of the next message group. (Messages can be grouped by transaction. See CREATE_QUEUE_TABLE.) FIRST_MESSAGE gets the first message fitting the specified criterion. |
visibility | ON_COMMIT or IMMEDIATE. |
wait | Length of time to wait for a message fitting the criterion. FOREVER, NO_WAIT, or the number of seconds to wait are all valid. |
msgid | Message to be dequeued. |
correlation | Used to specify a group label for the message. |
Previous | Table of Contents | Next |