09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Asynchronous Notifications<br />

BEGIN<br />

-- register for the pl/sql procedure notifyCB to be called on notification<br />

reginfo1 := sys.aq$_reg_info('WS.WS_BOOKEDORDERS_QUE:BOOKED_ORDERS',<br />

DBMS_AQ.NAMESPACE_AQ, 'plsql://WS.notifyCB',<br />

HEXTORAW('FF'));<br />

-- register for an e-mail to be sent to john@company.com on notification<br />

reginfo2 := sys.aq$_reg_info('WS.WS_BOOKEDORDERS_QUE:BOOKED_ORDERS',<br />

DBMS_AQ.NAMESPACE_AQ, 'mailto://john@company.com',<br />

HEXTORAW('FF'));<br />

-- register for an HTTP servlet to be invoked for notification<br />

reginfo3 := sys.aq$_reg_info('WS.WS_BOOKEDORDERS_QUE:BOOKED_ORDERS',<br />

DBMS_AQ.NAMESPACE_AQ,<br />

'http://xyz.oracle.com/servlets/NotifyServlet',<br />

HEXTORAW('FF'));<br />

-- Create the registration info list<br />

reginfolist := sys.aq$_reg_info_list(reginfo1);<br />

reginfolist.EXTEND;<br />

reginfolist(2) := reginfo2;<br />

reginfolist.EXTEND;<br />

reginfolist(3) := reginfo3;<br />

-- do the registration<br />

sys.dbms_aq.register(reginfolist, 3);<br />

END;<br />

Registering for Notifications Using the AQ XML Servlet<br />

Clients can register for AQ notifications over the Internet. See Chapter 17, "Internet<br />

Access to <strong>Advanced</strong> <strong>Queuing</strong>" for more information on registering for AQ<br />

notifications using SOAP.<br />

The register request has the following format:<br />

?xml version="1.0"?><br />

<br />

<br />

<br />

A Sample Application Using AQ 8-105

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!