Nothing up my exec enqueue_msg( 'This is a test.' ) Ĭommit needed, we don't commit in the enqueue select * from message_table ĭequeued and processed "This is a test." We'll use that table to let our procedure 'communicate' with us - our dequeue procedure that is called create or replace procedure notif圜B( context raw,ħ dequeue_options dbms_aq.dequeue_options_t Ĩ message_properties dbms_aq.message_properties_t ġ2 dequeue_options.msgid := descr.msg_id ġ3 dequeue_nsumer_name := nsumer_name ġ4 DBMS_AQ.DEQUEUE(queue_name => descr.queue_name,ġ6 message_properties => message_properties,Ģ0 ( 'Dequeued and processed "' || message.text || '"' ) Ĥ subscriber => sys.aq$_agent( 'recipient', null, null ) ) Ĥ sys.aq$_reg_info('AQ.MSG_QUEUE:RECIPIENT',Īnd that should do it - ready to go - and we select * from message_table PL/SQL procedure successfully create procedure enqueue_msg( p_msg in varchar2 )ģ enqueue_options dbms_aq.enqueue_options_t Ĥ message_properties dbms_aq.message_properties_t Ĩ message := message_typ('NORMAL MESSAGE', p_msg ) ĩ dbms_aq.enqueue(queue_name => 'msg_queue',ġ1 message_properties => message_properties,Ī simple procedure to enqueue a message onto that create table message_table( msg varchar2(4000) ) PL/SQL procedure successfully CREATE type aq.Message_typ as objectĢ ( subject VARCHAR2(30), text VARCHAR2(80)) Ĥ queue_payload_type => 'aq.Message_typ', User GRANT CONNECT, RESOURCE, aq_administrator_role TO aq I did say I was sort of busy and would try to get you an example when I could).Īnyway - here it "/ as drop user aq cascade (just a reminder - i've got a life too, sometimes camping without a laptop and not concocting examples is something I do too. ![]() Here is an example of an asyncronous dequeue of a message from a queue using PLSQL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |