Oracle8i Application Developer's Guide - Advanced Queuing
Release 2 (8.1.6)

A76938-01

Library

Product

Contents

Index

Prev Up Next

Administrative Interface, 20 of 25


Schedule a Queue Propagation

Figure 9-19 Use Case Diagram: Schedule a Queue Propagation



To refer to the table of all basic operations having to do with the Administrative Interface see:

 

Purpose:

Schedule propagation of messages from a queue to a destination identified by a specific dblink.

Usage Notes

Messages may also be propagated to other queues in the same database by specifying a NULL destination. If a message has multiple recipients at the same destination in either the same or different queues the message will be propagated to all of them at the same time.

Syntax

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:

Examples

See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Examples are provided in the following programmatic environments:

PL/SQL (DBMS_AQADM): Schedule a Queue Propagation


Note:

You may need to set up the following data structures for certain examples to work:

EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE (
   queue_table        => 'aq.objmsgs_qtab', 
   queue_payload_type => 'aq.message_typ',
   multiple_consumers => TRUE);
EXECUTE DBMS_AQADM.CREATE_QUEUE (
   queue_name         => 'aq.q1def',
   queue_table        => 'aq.objmsgs_qtab');

 

Schedule a Propagation from a Queue to other Queues in the Same Database

/* Schedule propagation from queue aq.q1def to other queues in the same 
   database  */
EXECUTE DBMS_AQADM.SCHEDULE_PROPAGATION(
   Queue_name    =>    'aq.q1def'); 
  

Schedule a Propagation from a Queue to other Queues in Another Database

/* Schedule a propagation from queue aq.q1def to other queues in another 
   database */
EXECUTE DBMS_AQADM.SCHEDULE_PROPAGATION(
   Queue_name    =>    'aq.q1def', 
   Destination   =>    'another_db.world'); 

Java (JDBC): Schedule a Queue propagation

/* Setup  */
public static void setup(AQSession aq_sess) throws AQException
{
     AQQueueTableProperty    qtable_prop;
     AQQueueProperty         queue_prop;
     AQQueueTable            q_table;
     AQQueue                 queue;

     qtable_prop = new AQQueueTableProperty("AQ.MESSAGE_TYP"); 
     qtable_prop.setMultiConsumer(true);

     q_table = aq_sess.createQueueTable ("aq", "objmsgs_qtab", qtable_prop);

     /* Create a new AQQueueProperty object: */
     queue_prop = new AQQueueProperty();
     queue = aq_sess.createQueue (q_table, "q1def", queue_prop);
}

/* Schedule propagation from a queue to other queues in the same database */
public static void example(AQSession aq_sess) throws AQException
{
     AQQueue         queue;
     AQAgent         agent1;        
     AQAgent         agent2;        

     /* Get the queue object */
     queue = aq_sess.getQueue("AQ", "q1def");

     queue.schedulePropagation(null, null, null, null, null);
}

/* Schedule propagation from a queue to other queues in another database */
public static void example(AQSession aq_sess) throws AQException
{
     AQQueue         queue;
     AQAgent         agent1;        
     AQAgent         agent2;        

     /* Get the queue object */
     queue = aq_sess.getQueue("AQ", "q1def");

     queue.schedulePropagation("another_db.world", null, null, null, null);
}


Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index