Oracle8i Application Developer's Guide - Advanced Queuing Release 2 (8.1.6) Part Number A76938-01 |
|
Administrative Interface, 3 of 25
Create a queue table for messages of a pre-defined type.
aq$_<queue_table_name>_e.
aq$<queue_table_name>.
aq$_<queue_table_name>_t
.
aq$_<queue_table_name>_i.
aq$_<queue_table_name>_s.
This table stores information about the subscribers.
aq$_<queue_table_name>_r.
This table stores information about rules on subscriptions.
aq$_<queue_table_name>_h.
This table stores the dequeue history data.
CLOB
, BLOB
or BFILE
objects are valid in an AQ message. You cant propagate these object types using AQ propagation with the Oracle8i release 8.1.x. In order to enqueue an object type that has a LOB
, you must first set the LOB_attribute
to EMPTY_BLOB
() and perform the enqueue. You can then select the LOB
locator that was generated from the queue table's view and use the standard LOB
operations. Please see the Oracle8i Application Developer's Guide - Large Objects (LOBs) for more information.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. :
CREATE type aq.Message_typ as object ( Subject VARCHAR2(30), Text VARCHAR2(80)); /* Note: if you do not stipulate a schema, you default to the user's schema. */ EXECUTE dbms_aqadm.create_queue_table ( Queue_table => 'aq.ObjMsgs_qtab', Queue_payload_type => 'aq.Message_typ');
EXECUTE dbms_aqadm.create_queue_table ( Queue_table => 'aq.RawMsgs_qtab', Queue_payload_type => 'RAW');
EXECUTE dbms_aqadm.create_queue_table ( Queue_table => 'aq.PriorityMsgs_qtab', Sort_list => 'PRIORITY,ENQ_TIME', Queue_payload_type => 'aq.Message_typ');
EXECUTE dbms_aqadm.create_queue_table ( Queue_table => 'aq.MultiConsumerMsgs_qtab', Multiple_consumers => TRUE, Queue_payload_type => 'aq.Message_typ');
EXECUTE dbms_aqadm.create_queue_table ( Queue_table => 'aq.Multiconsumermsgs8_1qtab', Multiple_consumers => TRUE, Compatible => '8.1', Queue_payload_type => 'aq.Message_typ');
EXECUTE dbms_aqadm.create_queue_table( queue_table => 'aq.aq_tbsMsg_qtab', queue_payload_type => 'aq.Message_typ', storage_clause => 'tablespace aq_tbs');
OOO4O uses database functionality for this operation.
Three examples follow of how to create a queue table using Java.
public static void example(AQSession aq_sess) throws AQException { AQQueueTableProperty qtable_prop; AQQueueProperty queue_prop; AQQueueTable q_table; AQQueue queue; /* Create a AQQueueTableProperty object (payload type Message_typ): */ qtable_prop = new AQQueueTableProperty("AQ.MESSAGE_TYP"); /* Create a queue table in aq schema */ q_table = aq_sess.createQueueTable ("aq", "ObjMsgs_qtab", qtable_prop); System.out.println("Successfully created ObjMsgs_qtab in aq schema"); }
public static void example(AQSession aq_sess) throws AQException { AQQueueTableProperty qtable_prop; AQQueueProperty queue_prop; AQQueueTable q_table; AQQueue queue; /* Create a AQQueueTableProperty object (payload type RAW): */ qtable_prop = new AQQueueTableProperty("RAW"); /* Create a queue table in aq schema */ q_table = aq_sess.createQueueTable ("aq", "RawMsgs_qtab", qtable_prop); System.out.println("Successfully created RawMsgs_qtab in aq schema"); } 3. Create a queue table for multiple consumers and prioritized messages public static void example(AQSession aq_sess) throws AQException { AQQueueTableProperty qtable_prop; AQQueueProperty queue_prop; AQQueueTable q_table; AQQueue queue; qtable_prop = new AQQueueTableProperty("RAW"); /* Enable multiple consumers */ qtable_prop.setMultiConsumer(true); qtable_prop.setCompatible("8.1"); /* Specify sort order as priority,enqueue_time */ qtable_prop.setSortOrder("PRIORITY,ENQ_TIME"); /* Create a queue table in aq schema */ q_table = aq_sess.createQueueTable ("aq", "PriorityMsgs_qtab", qtable_prop); System.out.println("Successfully created PriorityMsgs_qtab in aq schema"); }
public static void example(AQSession aq_sess) throws AQException { AQQueueTableProperty qtable_prop; AQQueueProperty queue_prop; AQQueueTable q_table; AQQueue queue; /* Create a AQQueueTableProperty object (payload type Message_typ): */ qtable_prop = new AQQueueTableProperty("AQ.MESSAGE_TYP"); /* Specify tablespace for queue table */ qtable_prop.setStorageClause("tablespace aq_tbs"); /* Create a queue table in aq schema */ q_table = aq_sess.createQueueTable ("aq", "aq_tbsMsg_qtab", qtable_prop); }
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|