DBMS_AQ¶
EDB Postgres Advanced Server Advanced Queueing provides message queueing and message processing for the Advanced Server database. User-defined messages are stored in a queue; a collection of queues is stored in a queue table. Procedures in the DBMS_AQADM package create and manage message queues and queue tables. Use the DBMS_AQ package to add messages to a queue or remove messages from a queue, or register or unregister a PL/SQL callback procedure.
Advanced Server also provides extended (non-compatible) functionality for the DBMS_AQ package with SQL commands, see the Database Compatibility for Oracle Developers SQL Guide for detailed information about the following SQL commands:
ALTER QUEUEALTER QUEUE TABLECREATE QUEUECREATE QUEUE TABLEDROP QUEUEDROP QUEUE TABLE
The DBMS_AQ package provides procedures that allow you to enqueue a message, dequeue a message, and manage callback procedures. The supported procedures are:
Function/Procedure |
Return Type |
Description |
|
n/a |
Post a message to a queue. |
|
n/a |
Retrieve a message from a queue if or when a message is available. |
|
n/a |
Register a callback procedure. |
|
n/a |
Unregister a callback procedure. |
Advanced Server’s implementation of DBMS_AQ is a partial implementation when compared to Oracle’s version. Only those procedures listed in the table above are supported.
Advanced Server supports use of the constants listed below:
Constant |
Description |
For Parameters |
|
Read the message without locking. |
|
|
This constant is defined, but will return an error if used. |
|
|
Delete the message after reading; the default. |
|
|
This constant is defined, but will return an error if used. |
|
|
Return the first available message that matches the search terms. |
|
|
Return the next available message that matches the search terms. |
|
|
This constant is defined, but will return an error if used. |
|
|
Wait forever if a message that matches the search term is not found, the default. |
|
|
Do not wait if a message that matches the search term is not found. |
|
|
The dequeue is part of the current transaction. |
|
|
This constant is defined, but will return an error if used. |
|
|
The message should be stored in a table. |
|
|
This constant is defined, but will return an error if used. |
|
|
Specifies that the message is ready to process. |
|
|
Specifies that the message is waiting to be processed. |
|
|
Specifies that the message has been processed. |
|
|
Specifies that the message is in the exception queue. |
|
|
This constant is defined, but will return an error if used |
|
|
This constant is defined, but will return an error if used |
|
|
Accept notifications from DBMS_AQ queues. |
|
|
This constant is defined, but will return an error if used |
|
The DBMS_AQ configuration parameters listed in the following table can
be defined in the postgresql.conf file. After the configuration
parameters are defined, you can invoke the DBMS_AQ package to use and
manage messages held in queues and queue tables.
Parameter |
Description |
|
The maximum number of workers to run. |
|
The idle time a worker must wait before exiting. |
|
The minimum time a worker can run before exiting. |
|
The minimum time between creating workers. |
|
The maximum number of messages to process in a single transaction. The default batch size is 10. |
|
The size of DBMS_AQ’s hash table of databases. The default value is 1024. |
|
The size of DBMS_AQ’s hash table of pending retries. The default value is 1024. |