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.

Creating a Queue Table<br />

}<br />

/* Create a queue table in aq schema */<br />

q_table = aq_sess.createQueueTable ("aq", "ObjMsgs_qtab", qtable_prop);<br />

System.out.println("Successfully created ObjMsgs_qtab in aq schema");<br />

Creating a queue table for queues containing messages of RAW type<br />

public static void example(AQSession aq_sess) throws AQException<br />

{<br />

AQQueueTableProperty qtable_prop;<br />

AQQueueProperty queue_prop;<br />

AQQueueTable q_table;<br />

AQQueue queue;<br />

}<br />

/* Create a AQQueueTableProperty object (payload type RAW): */<br />

qtable_prop = new AQQueueTableProperty("RAW");<br />

/* Create a queue table in aq schema */<br />

q_table = aq_sess.createQueueTable ("aq", "RawMsgs_qtab", qtable_prop);<br />

System.out.println("Successfully created RawMsgs_qtab in aq schema");<br />

3. Create a queue table for multiple consumers and prioritized messages<br />

public static void example(AQSession aq_sess) throws AQException<br />

{<br />

AQQueueTableProperty qtable_prop;<br />

AQQueueProperty queue_prop;<br />

AQQueueTable q_table;<br />

AQQueue queue;<br />

qtable_prop = new AQQueueTableProperty("RAW");<br />

/* Enable multiple consumers */<br />

qtable_prop.setMultiConsumer(true);<br />

qtable_prop.setCompatible("8.1");<br />

/* Specify sort order as priority,enqueue_time */<br />

qtable_prop.setSortOrder("PRIORITY,ENQ_TIME");<br />

/* Create a queue table in aq schema */<br />

9-10 <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!