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

Part Number A76938-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

JMS Operational Interface: Basic Operations (Point-to-Point), 12 of 22


Send Messages Using a Queue Sender by Specifying Send Options

Figure 14-10 Use Case Diagram: Send Messages using a Queue Sender by Specifying Send Options



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

  • "Use Case Model: Operational Interface -- Basic Operations"

 

Purpose

Send messages using a queue sender by specifying send options.

Usage Notes

If the QueueSender has been created with a default queue, then the queue parameter may not necessarily be supplied in the send call. If a queue is specified in the send operation, then this value will override the default queue of the QueueSender.

If the QueueSender has been created without a default queue, then the queue parameter must be specified in every send call.

Syntax

Example

Example1

/* Create a sender to send messages to any queue */ 
/* Send a message to new_orders_que with priority 2 and timetoLive 100000 
   milliseconds */
QueueSession  jms_sess;
QueueSender  sender1;
TextMessage mesg;
Queue   new_orders_que
sender1 = jms_sess.createSender(null); 
sender1.send(new_orders_que, mesg, DeliveryMode.PERSISTENT, 2, 100000);

Example2

/* Create a sender to send messages to a specific  queue */ 
/* Send a message with priority 1 and timetoLive 400000 milliseconds */
QueueSession jms_sess;
QueueSender sender2;
Queue   billed_orders_que;
TextMessage mesg;
sender2 = jms_sess.createSender(billed_orders_que);
sender2.send(mesg, DeliveryMode.PERSISTENT, 1, 400000);
 

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index