My Oracle Support Banner

Procedure to Dequeue Messages from Any Queue Not Using Message Grouping (Doc ID 243665.1)

Last updated on JULY 19, 2023

Applies to:

Oracle Database - Enterprise Edition - Version 8.1.7.0 to 12.1.0.2 [Release 8.1.7 to 12.1]
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Information in this document applies to any platform.

Goal

Dequeues messages from a queue not using message grouping regardless of the payload type for a specified consumer by dequeuing messages with the REMOVE_NODATA option. Messages are removed without reading the data. This means that the payload parameter is not used and can be of any type (in this example RAW(1)).

Note the following:  

1. For Single Consumer Queues specify the consumer parameter as NULL. For Multi-Consumer Queues specify the relevant consumer name. If the queue is an exception queue then note that you will have to enable it for dequeue via DBMS_AQADM.START_QUEUE in order to consume the messages within it and the consumer name should be specified as NULL.

2. The message state will be changed to PROCESSED and whether the messages are removed from the underlying queue table depends on the retention time specified for that queue.

3. For Queues created in Queue Tables with message_grouping set to DBMS_AQ.TRANSACTIONAL Queues, the equivalent procedure is available in Note: 305641.1

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
 Requirements
 Configuring
 Instructions
 Script
 Sample Output
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.