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

StackOverflow https://stackoverflow.com/questions/4272454

  •  28-09-2019
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top