09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Dequeue Features<br />

Eastern Region Shipping handles orders for the Eastern region of the U.S.<br />

Overseas Shipping handles all non-U.S. orders.<br />

Overseas Shipping checks for the XMLType attribute to identify special<br />

<br />

handling.<br />

Eastern Region Shipping also handles all U.S. rush orders.<br />

Each shipping application subscribes to the OE booked orders queue. The following<br />

rule-based subscriptions are defined by the Order Entry user to handle the routing<br />

of booked orders from the Order Entry application to each of the Shipping<br />

applications.<br />

PL/SQL (DBMS_AQADM Package): Example Code<br />

CONNECT OE/OE;<br />

Western Region Shipping defines an agent called 'West_Shipping' with the WS<br />

booked orders queue as the agent address (destination queue where messages must<br />

be delivered). This agent subscribes to the OE booked orders queue using a rule<br />

specified on order region and ordertype attributes.<br />

/* Add a rule-based subscriber for West Shipping -<br />

West Shipping handles Western region U.S. orders,<br />

Rush Western region orders are handled by East Shipping: */<br />

DECLARE<br />

subscriber aq$_agent;<br />

BEGIN<br />

subscriber := aq$_agent('West_Shipping', 'WS.WS_bookedorders_que', null);<br />

dbms_aqadm.add_subscriber(<br />

queue_name => 'OE.OE_bookedorders_que',<br />

subscriber => subscriber,<br />

rule => 'tab.user_data.orderregion =<br />

''WESTERN'' AND tab.user_data.ordertype != ''RUSH''');<br />

END;<br />

/<br />

Eastern Region Shipping defines an agent called East_Shipping with the ES<br />

booked orders queue as the agent address (the destination queue where messages<br />

must be delivered). This agent subscribes to the OE booked orders queue using a<br />

rule specified on orderregion, ordertype and customer attributes.<br />

/* Add a rule-based subscriber for East Shipping -<br />

East shipping handles all Eastern region orders,<br />

East shipping also handles all U.S. rush orders: */<br />

DECLARE<br />

subscriber aq$_agent;<br />

A Sample Application Using AQ 8-87

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

Saved successfully!

Ooh no, something went wrong!