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.

For details on XMlType operations refer to Application Developer's guide - XML<br />

Define transformations to convert <strong>Oracle</strong> objects to XMLType.<br />

<br />

General Features of <strong>Advanced</strong> <strong>Queuing</strong><br />

See Also: <strong>Oracle</strong>9i XML Database Developer’s Guide - <strong>Oracle</strong> XML<br />

DB for details on XMLType operations<br />

Define rule-based subscribers that query message content using XMLType<br />

<br />

operators such as XMLType.existsNode() and XMLType.extract().<br />

In the BooksOnline application, assume that the Overseas Shipping site represents<br />

the order as SYS.XMLType. The Order Entry site represents the order as an <strong>Oracle</strong><br />

object, ORDER_TYP.<br />

The Overseas queue table and queue are created as follows:<br />

BEGIN<br />

dbms_aqadm.create_queue_table(<br />

queue_table => 'OS_orders_pr_mqtab',<br />

comment => 'Overseas Shipping MultiConsumer Orders queue table',<br />

multiple_consumers => TRUE,<br />

queue_payload_type => 'SYS.XMLTtype',<br />

compatible => '8.1');<br />

END;<br />

BEGIN<br />

dbms_aqadm.create_queue (<br />

queue_name => 'OS_bookedorders_que',<br />

queue_table => 'OS_orders_pr_mqtab');<br />

END;<br />

Since the representation of orders at the Overseas Shipping site is different from the<br />

representation of orders at the Order Entry site, a transformation is applied before<br />

messages are propagated from the Order Entry site to the Overseas Shipping site.<br />

/* Add a rule-based subscriber (for Overseas Shipping) to the Booked orders<br />

queues with Transformation. Overseas Shipping handles all non-US orders: */<br />

DECLARE<br />

subscriber aq$_agent;<br />

BEGIN<br />

subscriber := aq$_agent('Overseas_Shipping','OS.OS_bookedorders_que',null);<br />

dbms_aqadm.add_subscriber(<br />

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

subscriber => subscriber,<br />

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

transformation => 'OS.OE2XML');<br />

END;<br />

A Sample Application Using AQ 8-15

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

Saved successfully!

Ooh no, something went wrong!