Oracle9i Application Developer's Guide - Advanced Queuing
Release 1 (9.0.1)

Part Number A88890-02
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

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

JMS Operational Interface: Basic Operations (Publish-Subscribe), 21 of 37


Creating a Durable Subscriber for an ADT Topic with Selector

Figure 15-19 Use Case Diagram: Publish-Subscribe - Create a Durable Subscriber for an ADT Topic with Selector


Text description of adq15jps24.gif follows
Text description of the illustration adq15jps24.gif


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

Create a durable subscriber for an adt topic with selector.

Usage Notes

To create a durable subscriber for a Topic of Oracle Object type, the client needs to specify the CustomDatumFactory for the Oracle Object Type in addition to the Topic and subscriber name.

Optionally, a message selector may be specified. Only messages matching the selector will be delivered to the subscriber.

ADT messages do not contain any user defined properties. However, the selector can be used to select messages based on priority or correlation id or attribute values of the message payload

The syntax for the selector for queues containing ADT messages is different from the syntax for selectors on queues containing standard JMS payloads (text, stream, object, bytes, map)

The selector is similar to the AQ rules syntax

a. Selector on priority or correlation is specified as follows

For example.:- priority > 3 AND corrid = 'Fiction'

b. Selector on message payload is specified as follows. The attribute

name must be prefixed with tab.user_data.

For example:-

tab.user_data.color = 'GREEN' AND tab.user_data.price < 30000

Syntax

Example

TopicConnectionFactory    tc_fact   = null;
TopicConnection           t_conn    = null;
TopicSession              jms_sess;
TopicSubscriber           subscriber1;
Topic                     shipped_orders;
int                       myport = 5521;
AQjmsAgent[]              recipList;    
/* the java mapping of the oracle object type created by J Publisher */
ADTMessage                message; 
  
/* create connection and session */
tc_fact = AQjmsFactory.getTopicConnectionFactory("MYHOSTNAME",
                                                  "MYSID", myport, "oci8");
t_conn = tc_fact.createTopicConnection("jmstopic", "jmstopic");
jms_sess = t_conn.createTopicSession(true, Session.CLIENT_ACKNOWLEDGE);    
  
shipped_orders = ((AQjmsSession )jms_sess).getTopic("OE", "Shipped_Orders_
Topic");

/* create a subscriber, specifying the correct CustomDatumFactory  and selector 
*/
subscriber1 = jms_sess.createDurableSubscriber(shipped_orders, 
"WesternShipping", " priority > 1 and tab.user_data.region like 'WESTERN %'",
false, ADTMessage.getFactory());



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

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback