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.

Enqueue Features<br />

the message: */<br />

msgprop.priority := shipping_priority;<br />

dbms_aq.enqueue('OE.OE_bookedorders_que', enqopt, msgprop,<br />

OE_enq_order_data, enq_msgid);<br />

COMMIT;<br />

END;<br />

/<br />

/* At each region, similar booked order queues are created. The orders are<br />

propagated from the central Order Entry's booked order queues to the regional<br />

booked order queues.For example, at the western region, the booked orders<br />

queue is created.<br />

Create a priority queue table for WS shipping: */<br />

EXECUTE dbms_aqadm.create_queue_table( \<br />

queue_table => 'WS_orders_pr_mqtab',<br />

sort_list =>' priority,enq_time', \<br />

comment => 'West Shipping Priority \<br />

MultiConsumer Orders queue table',\<br />

multiple_consumers => TRUE, \<br />

queue_payload_type => 'BOLADM.order_typ', \<br />

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

/* Booked orders are stored in the priority queue table: */<br />

EXECUTE dbms_aqadm.create_queue ( \<br />

queue_name => 'WS_bookedorders_que', \<br />

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

/* At each region, the shipping application dequeues orders from the regional<br />

booked order queue according to the orders' shipping priorities, processes<br />

the orders, and enqueues the processed orders into the shipped orders queues<br />

or the back orders queues. */<br />

Visual Basic (OO4O): Example Code<br />

Dim OraSession as object<br />

Dim OraDatabase as object<br />

Dim OraAq as object<br />

Dim OraMsg as Object<br />

Dim OraOrder,OraCust,OraBook,OraItem,OraItemList as Object<br />

Dim Msgid as String<br />

Set OraSession = CreateObject("<strong>Oracle</strong>InProcServer.XOraSession")<br />

Set OraDatabase = OraSession.DbOpenDatabase("dbname", "user/pwd", 0&)<br />

8-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!