09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

See Also:<br />

Creating a Topic Receiver for a Topic of <strong>Oracle</strong> Object Type (ADT) Messages<br />

Table 15–1 for a list of publish-subscribe basic operations in the<br />

<br />

JMS operational interface<br />

"Class - oracle.jms.AQjmsSession" on page B-53<br />

"Creating a Topic Receiver for a Topic of Standard JMS Type<br />

<br />

Messages" on page 15-44<br />

Purpose<br />

Create a topic receiver for a topic of ADT messages with selector.<br />

Usage Notes<br />

AQ allows messages to be sent to all subscribers of a topic or to specified recipients.<br />

These receivers may or may not be subscribers of the topic. If the receiver is not a<br />

subscriber to the topic, it will receive only those messages that are explicitly<br />

addressed to it.<br />

This method must be used order to create a TopicReceiver object for consumers that<br />

are not 'Durable Subscribers'. The CustomDatumFactory of the <strong>Oracle</strong> Object type<br />

of the queue must be specified. A message selector can also be specified. This can be<br />

null. The syntax for the message selector is the same as that of a QueueReceiver for<br />

queues with ADT messages.<br />

Syntax<br />

Java (JDBC): <strong>Oracle</strong>9i Supplied Java Packages Reference oracle.jms,<br />

AQjmsSession.createTopicReceiver<br />

Example<br />

TopicConnectionFactory tc_fact = null;<br />

TopicConnection t_conn = null;<br />

TopicSession t_sess = null;<br />

TopicSession jms_sess;<br />

Topic shipped_orders;<br />

int myport = 5521;<br />

TopicReceiver receiver;<br />

/* create connection and session */<br />

tc_fact = AQjmsFactory.getTopicConnectionFactory("MYHOSTNAME",<br />

"MYSID", myport, "oci8");<br />

t_conn = tc_fact.createTopicConnection("jmstopic", "jmstopic");<br />

JMS Operational Interface: Basic Operations (Publish-Subscribe) 15-47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!