There are a number of terms related to "advanced queuing" that you will have to understand to use its functionality:
Message: A message is the basic unit of information that is transmitted. You define the information in a message as an object type.
Queue: A queue is a repository for messages. You can define any number of individual queues. Messages can be enqueued, or placed, into a queue, and dequeued, or removed, from a queue.
Queue table: Queues are stored in queue tables, which are database tables that can contain one or more queues. You can use standard SQL statements to query information in a queue table.
Agent: An agent is a queue user. Agents interact with queues. There are two types of agents: a producer, who creates messages for a queue, and a consumer, who takes messages from queues.
Recipient and subscription lists: A message can be directed toward more than one recipient, or to a list of subscribers associated with a queue. A queue can have a subscriber list, but you can still direct a message to a particular recipient or recipients explicitly.
Rule: A rule is a Boolean expression that acts as a filter for subscribers to a queue. For instance, a message could be directed to different subscribers based on priority or some quality of its message payload.
Rule-based subscriber: A rule-based subscriber is a subscriber to a queue who gets messages only based on the evaluation of a rule.
Queue monitor: The queue monitor is a background process that performs administrative tasks for queues, such as collecting statistics on a queue or limiting the window of time when a message can be retrieved. The queue monitor is optional.
Updates and Shifts in emphasis for Oracle 23c
It is important to note the following 1) updates and 2) shifts in emphasis for Oracle 23c:
β Still Supported in Oracle 23c
All of the following remain part of the Oracle AQ infrastructure:
Message: Still the core unit of communication.
Queue / Queue Table: Still central to AQ structure.
Agent (Producer/Consumer): Still relevant in enqueue/dequeue logic.
Recipient/Subscription lists: Still used in multi-consumer queues.
Rule / Rule-Based Subscriber: These are still valid and used for content-based routing.
Queue Monitor (QMNn): Still exists as a background process, though its visibility is minimal in many cloud-managed environments.
π What's Changed in Oracle 23c?
Oracle 23c shifts emphasis toward newer messaging and eventing frameworks, such as:
Oracle Transactional Event Queues (TxEventQ): a more modern replacement for some AQ use cases, offering
Kafka-style semantics and native JSON support.
JSON payload support and RESTful eventing: enabling event-driven microservices.
Autonomous Database and cloud environments abstract some of the AQ internals, such as manual queue monitor configurations.
π Clarification
No specific AQ term from your list is marked as *deprecated* in Oracle 23c documentation as of this writing. But Oracle has stated that some older, synchronous AQ interfaces and DBMS\_AQ packages may be considered for future deprecation in favor of TxEventQ and REST-based event streaming.
The concept behind Advanced Queuing (also known as AQ) is fairly simple. In a normal interaction with an Oracle database,
the communication between a user and the database server is synchronous[1] when a user sends a message to the Oracle server and waits for a response from the server. Advanced Queuing uses the capabilities of the Oracle server to implement asynchronous communication. A user sends a message to a queue, where it waits until another user or process takes the message out of the queue. The sender is not blocked while waiting for a response from the server, as it is with synchronous communication. The process of communication between the sender and recipient of a message is still guaranteed. The main difference in implementation is that the delivery time is not guaranteed, because it is dependent on when a recipient retrieves a
message as well as when the message is sent.
Environment Setup
Administration and access privileges for advanced queuing are controled using two roles:
AQ_ADMINISTRATOR_ROLE - Allows creation and administration of queuing infrastructure.
AQ_USER_ROLE - Allows access to queues for enqueue and dequeue operations.
In the following examples I have used two schemas, one owning the queuing infrastructure and another with access to it.
CONNECT / AS SYSDBA
CREATE USER aq_admin IDENTIFIED BY aq_admin DEFAULT TABLESPACE users;
GRANT connect TO aq_admin;
GRANT create type TO aq_admin;
GRANT aq_administrator_role TO aq_admin;
ALTER USER aq_admin QUOTA UNLIMITED ON users;
CREATE USER aq_user IDENTIFIED BY aq_user DEFAULT TABLESPACE users;
GRANT connect TO aq_user;
GRANT aq_user_role TO aq_user;
Each statement reflects current and valid practices for setting up Oracle Advanced Queuing (AQ) with a separation of responsibilities between an administrative schema (`aq_admin`) and a consuming/producing user (`aq_user`). Here is a breakdown confirming their continued validity:
β Analysis of Each SQL Statement
CREATE USER ...
β Still supported. No changes to user creation syntax in 23c.
GRANT connect TO aq_admin;
β Valid. While the CONNECT role has changed over versions (itβs now a basic privilege set), itβs still functional and not deprecated.
GRANT create type TO aq_admin;
β Valid. Required to define object types used in AQ payloads. Still current.
GRANT aq_administrator_role TO aq_admin;
β Valid and recommended. This role is still the correct way to grant full administrative control over queuing infrastructure.
ALTER USER aq_admin QUOTA UNLIMITED ON users;
β Valid. Required for persistent queue storage. No change in 23c.
GRANT connect TO aq_user;
β Valid. Same notes as above; not deprecated.
GRANT aq_user_role TO aq_user;
β Valid. Still required for enqueuing/dequeuing messages by non-administrators.
π§ Additional Note for Oracle 23c
While none of these are deprecated, Oracle 23c does encourage the use of:
JSON-based queuing
Transactional Event Queues (TxEventQ)
Multitenant-aware AQ setup using local and common users (if in CDB/PDB)
If you are working in a multitenant or cloud-native environment, you might also consider configuring Application Containers or Pluggable Databases to isolate AQ infrastructure further.
β Conclusion: Your SQL is fully valid and not deprecated in Oracle 23c. It aligns with best practices for a traditional AQ configuration using separate schemas for administration and usage.
The following series of images illustrates Advanced Queuing at work:
How Queues are set up1) Queues are set up in an Oracle Database
2) A producer creates a message and sends it to a particular queue
3) The queue holds the message until ...
4) A consumer retrieves the message, at which point it leaves the queue
When to use Advanced Queuing
So, when would you use Advanced Queuing, with its asynchronous communication? First of all, Advanced Queuing would not
be appropriate if you are depending on an interaction between the client and the server. If a response is required before the client can move on, there is generally no advantage to asynchronous communication. If you do not need a response from the server before the client can move on, you might want to consider Advanced Queuing. It can be especially useful if an application is requesting a service from another application, and the application receiving the requests may have limited resources available to handle requests. For instance, you might use Advanced Queuing to make a credit-check call as part of an order entry process. The credit-check application may be swamped with requests at any given time, so simply placing the requests into a queue will avoid you having to wait for a response. Of course, this means that the application will either have to check back for the results of the credit check later, or make it clear to the user that any order placed is subject to a credit check before the order can actually be fulfilled.
Coding the Stored Procedure
Modern ava Stored Procedure rewritten using Oracle 23c best practices, based on:
β Transactional Event Queues (TxEventQ)
β JSON payloads (object-free, lightweight)
β JDBC Thin Driver (oracle.jdbc.OracleDriver)
β Secure, maintainable queue interaction
π§ Prerequisites (once per schema)
Before running the stored procedure, ensure the following setup has been completed in Oracle 23c:
-- 1. Create a JSON-enabled event queue
BEGIN
DBMS_AQADM.CREATE_EVENT_QUEUE(
queue_name => 'credit_alert_queue',
queue_table => 'credit_alert_qtab',
payload_type => 'JSON');
END;
/
-- 2. Start the queue
BEGIN
DBMS_AQADM.START_QUEUE(queue_name => 'credit_alert_queue');
END;
/
βοΈ Java Stored Procedure Using TxEventQ and JSON