| Lesson 2 | What is Advanced Queuing? |
| Objective | Explain Oracle Advanced Queuing, its transaction boundaries, and when to consider AQ or TxEventQ in Oracle 26ai |
The acronym AQ in Oracle stands for Advanced Queuing. Oracle Advanced Queues provide a database-integrated messaging system that allows applications to exchange information asynchronously using database tables as the transport layer. Because AQ is built into the Oracle Database engine, it inherits core database capabilities such as transactional consistency, security, backup and recovery, and high availability.
In this lesson, you will learn what Advanced Queues are, how Oracle stores messages in queue tables, and why AQ remains a relevant option in Oracle 26ai and cloud-enabled deployments. Later lessons in this module will show how to enqueue and dequeue messages, build PL/SQL applications, and configure queue propagation. This page focuses on the concepts and architecture.
Many applications need to perform work asynchronously. For example, an order-entry system may take a customer’s order immediately, then process payment, inventory checks, and shipment in the background. Rather than forcing all systems to be online and synchronized at once, a messaging system decouples producers and consumers of work.
Oracle Advanced Queues implement this messaging layer inside the database. Instead of running a separate message broker, AQ uses Oracle tables to store messages and Oracle background processes to manage delivery. This has several benefits:
At the logical level, Advanced Queuing revolves around three core concepts:
The figure summarizes the producer-to-queue-to-consumer flow:
A queue table is a specially created Oracle table that holds messages for one or more queues. You do not manually design its columns; instead, you specify message characteristics and storage options, and Oracle builds the underlying structure for you. The queue table:
Use DBMS_AQADM for administration and supported messaging interfaces such as DBMS_AQ for enqueue/dequeue. Do not manually update message rows or add arbitrary indexes and partitions to Oracle-managed queue structures. Queue storage is an implementation detail with documented administration rules.
Suppose an application inserts order 801 and must request warehouse processing. With persistent enqueue visibility set to ON_COMMIT, it can insert the order and enqueue the work item in the same transaction. A commit makes both durable; a rollback abandons both. This avoids committing the order and then losing the request before an unrelated messaging call succeeds.
This is a transaction walkthrough, not a complete installation script. Immediate visibility and buffered messaging have different semantics. Choose the options deliberately rather than assuming every enqueue shares the caller's transaction.
External effects need separate protection. Sending an email or calling a payment API does not automatically roll back with the database. Use a stable event identifier and an idempotent consumer or external API so retrying work does not charge a customer twice. Database messaging guarantees do not eliminate this application responsibility.
A queue is defined on top of a queue table. Each queue has its own:
Consumers can be PL/SQL blocks, background jobs, middle-tier services, or external applications using database connectivity. Consumers in Oracle 26ai deployments might be:
Oracle 26ai provides classic AQ and Transactional Event Queues (TxEventQ), an optimized implementation previously called sharded queues. Both integrate messaging with the database, but the selection should follow workload and API requirements.
For an existing AQ application, begin with its payload type, subscriber model, queue administration, and operational procedures. For a new high-throughput event workload, evaluate TxEventQ's supported interfaces and ordering model. Do not treat a change of queue technology as merely renaming an object.
A single-consumer queue can distribute work among competing workers. A multiconsumer queue tracks delivery for its intended recipients. Neither arrangement means that arbitrary parallel consumers finish messages in one global order. If updates for one customer must be applied sequentially, make that ordering requirement part of the design and test it under concurrency.
Advanced Queues are particularly useful when you need:
If your architecture already depends heavily on the Oracle Database, AQ can be simpler and more maintainable than running a separate message broker—especially for small to medium integration workloads that benefit from transactional guarantees and centralized administration.
Because AQ runs inside the database, performance and reliability are closely tied to standard Oracle tuning practices:
Later lessons in this module will show how enqueue and dequeue options affect concurrency, how to configure retention and message expiration, and how to tune queue tables for performance.
This page is the conceptual foundation for the Advanced Queues lessons. Use it as your reference for what AQ is and how its core components fit together. The following pages build on this material:
Once you are comfortable with the ideas presented here—message, queue, queue table, and the overall AQ architecture—you will be ready to explore the implementation details in the remaining lessons of this module.
Reference: Oracle introduction to TxEventQ and Advanced Queuing.