Oracle9i Application Developer's Guide - Advanced Queuing Release 1 (9.0.1) Part Number A88890-02 |
|
Administrative Interface, 3 of 36
Create a queue table for messages of a predefined 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 can propagate these object types using AQ propagation with Oracle since release 8.1.x. To enqueue an object type that has an 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. See the Oracle9i 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'); Create a queue table for queues containing messages of object type with XMLType attributes CREATE OR REPLACE TYPE order_xml_typ as OBJECT ( orderno NUMBER, details XMLTYPE); execute dbms_aqadm.create_queue_table( queue_table => 'OS_orders_pr_mqtab', comment => 'Overseas Shipping MultiConsumer Orders queue table', multiple_consumers => TRUE, queue_payload_type => 'OS.order_xml_typ', compatible => '8.1');
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');
BEGIN dbms_aqadm.create_queue_table ( queue_table=> 'AQ_ADMIN.TEST', queue_payload_type=> 'RAW', storage_clause=> 'STORAGE (FREELISTS 4 FREELIST GROUPS 2)', compatible => '8.1'); COMMIT; END;
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-2001, Oracle Corporation. All Rights Reserved. |
|