Oracle Advanced Queuing (AQ) with Dead-Letter Queue — Full Description
What Oracle AQ is
Oracle Advanced Queuing (AQ) is a native, kernel-level messaging system embedded directly inside the Oracle Database engine.
It allows the database to manage units of work as messages, with the same transactional guarantees as SQL operations.
AQ is not middleware, not an external broker, and not an application library.
It is part of the Oracle database kernel.
What a message represents
A message represents an intention to process something.
It is a runtime entity, not a declared object.
Key characteristics:
Separation of responsibilities
Oracle AQ separates concerns clearly:
A row existing in a table does not mean it was successfully processed.
Only successful message consumption confirms processing.
Message lifecycle
The lifecycle of a message is entirely engine-controlled:
AQ does not inspect application errors, SQLCODE, or exceptions.
Success vs failure semantics
AQ defines processing outcome strictly:
This design ensures transactional truth.
Retry mechanism
AQ includes an engine-managed retry system:
This avoids custom retry logic and inconsistent behavior.
Dead-Letter Queue (DLQ) concept
The Dead-Letter Queue is AQ’s fault-isolation mechanism.
Purpose:
In Oracle AQ:
When messages move to DLQ
A message is moved to the DLQ when:
At that point:
This happens entirely inside the database engine.
What DLQ contains
The DLQ stores:
The DLQ does not automatically store:
If error details are needed, they must be logged explicitly.
AQ does not replace business tables.
Typical separation:
· Business tables store domain data
· AQ stores processing intent
A row existing in a table does not mean it was successfully processed — only a committed dequeue confirms processing success.
Concurrency behavior
AQ is designed for high concurrency:
Consumers compete for messages; ownership is not tied to the producer.
Consumer execution model
Consumer loops:
An empty queue is a normal state, not an error condition.
Why DLQ is essential
Without DLQ semantics:
With AQ DLQ:
This pattern is identical to enterprise messaging systems (JMS, MQ, Kafka), but implemented inside Oracle DB.
What AQ DLQ is NOT
AQ DLQ is not:
It is a resilience and isolation feature, not an observability feature.
Architectural value
Oracle AQ with Dead-Letter Queue provides:
Examples are attached.