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.

Converting Messages<br />

Because the MQSeries native message format does not allow you to specify<br />

user-defined message property information, you cannot specify values that the<br />

gateway MQSeries driver interprets as values to use for AQ message properties. As<br />

a result, the AQ message properties of the message enqueued to the destination<br />

queue are based on the default mappings described in Table 18–1 and the default<br />

values for the remaining (nonmapped) AQ properties.<br />

Using XML Message Propagation: Examples<br />

This section provides examples of how to set up propagation between AQ queues<br />

with ADT payloads and foreign queues using XML messages.<br />

The messages to propagate in the examples are book orders. The payload type of<br />

the AQ queue, AQ_book_orders, is book_order_typ. The foreign queue, FQ_<br />

book_orders, is capable of storing XML documents.<br />

The following PL/SQL script creates entities in the <strong>Oracle</strong> database for the two<br />

inbound and outbound propagation examples that follow. Assume that the script is<br />

run by database user mgwuser.<br />

-- create the type book_order_typ<br />

CREATE OR REPLACE TYPE book_order_typ AS OBJECT<br />

(<br />

order_no number,<br />

book_name varchar2(100),<br />

book_isbn varchar2(15),<br />

book_amount number,<br />

payment varchar2(30),<br />

ship_addr varchar2(160),<br />

order_date date<br />

);<br />

/<br />

-- grant privilege to PUBLIC<br />

GRANT EXECUTE ON book_order_typ to PUBLIC;<br />

BEGIN<br />

-- create queue table<br />

dbms_aqadm.create_queue_table(<br />

queue_table => ‘book_order_qtab’,<br />

queue_payload_type => ‘book_order_typ’,<br />

multiple_consumers => TRUE,<br />

compatible => ‘8.1’);<br />

-- create the queue<br />

dbms_aqadm.create_queue(<br />

18-40 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

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

Saved successfully!

Ooh no, something went wrong!