jeph perro
jeph perro

Reputation: 6422

How to tell in Oracle AQ which messages have been consumed from a multiple consumer queue

I'm new to Oracle AQ.

I have created a table and a queue like so:

EXEC dbms_aqadm.create_queue_table(queue_table=>'MY_QUEUE_TABLE',
                                   queue_payload_type=>'sys.aq$_jms_text_message',
                                   multiple_consumers=>TRUE);

EXEC dbms_aqadm.create_queue(queue_name=>'CONTACT_INFO_QUEUE',
                             queue_table=>'MY_QUEUE_TABLE',
                             max_retries=>24,
                             retry_delay=>60,
                             retention_time=>3600);

Then I wrote a Listener to the queue in Java. When I start the Listener, it waits 6 minutes and then collects all the messages from the queue.

But I can't tell in MY_QUEUE_TABLE which messages have been consumed. Because I want a multiple consumer queue, I think the messages should stick around. However, how does Oracle AQ keep track of which messages each listener has consumed?

Upvotes: 1

Views: 3054

Answers (1)

erbsock
erbsock

Reputation: 1217

Each queue will keep track and ensure that all consumers have dequeued. You can look at the actual queue table to see how many consumers have consumed a message. Check aq$_my_queue_table and aq$_my_queue_table_I to see the status of messages.

Upvotes: 2

Related Questions