Oracle8i Application Developer's Guide - Advanced Queuing Release 2 (8.1.6) Part Number A76938-01 |
|
JMS Operational Interface: Basic Operations (Publish-Subscribe), 28 of 29
Create a topic receiver for a topic of standard jms type messages.
AQ allows messages to be sent to specified recipients. These receivers may or may not be subscribers of the topic. If the receiver is not a subscriber to the topic, it will receive only those messages that are explicitly addressed to it.
This method must be used order to create a TopicReceiver object for consumers that are not 'Durable Subscribers'.A message selector can be specified. The syntax for the message selector is the same as that of a QueueReceiver.
TopicConnectionFactory tc_fact = null; TopicConnection t_conn = null; TopicSession t_sess = null; TopicSession jms_sess; Topic shipped_orders; int myport = 5521; TopicReceiver receiver; /* 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("WS", "Shipped_Orders_ Topic"); receiver = ((AQjmsSession)jms_sess).createTopicReceiver(shipped_orders, "WesternRegion", null);
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|