Oracle AQ's requeue
I am trying to write universal pl/sql to (re)enqueue message already enqueued (present in queue table in whatever state).
It works fine when dequeue is enabled on the queue so I can dequeue first in browse mode in order to populate DBMS_AQ.message_properties_t
and load from existing message. But how can I fetch those when dequeue is disabled?
DBMS_AQ.enqueue(
queue_name => fine,
enqueue_options => fine,
message_properties => ho开发者_开发技巧w from existing message,
payload => how from existing message
(probably can select, not big deal),
msgid => fine);
Thanks
There is a great example of how to do this on Oracle's site: http://download.oracle.com/docs/cd/B10500_01/appdev.920/a96587/apexampl.htm
Basically you can "dequeue" in a non destructive fashion (IE dequeue for purposes of browsing). Because you aren't dequeuing though, the message still stay in place.
You HAVE to enable DEQUEUING in order to get a message, no matter if in browse or remove mode:
begin
sys.dbms_aqadm.start_queue('[QUEUE_NAME]', true, true);
end;
/
精彩评论