09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Publishing a Message Using a Topic Publisher—Specifying Correlation and Delay<br />

See Also:<br />

Purpose<br />

Publish a message specifying correlation and delay.<br />

Usage Notes<br />

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

<br />

JMS operational interface<br />

"Interface - javax.jms.TopicPublisher" on page B-38<br />

"Publishing a Message Using a Topic Publisher—with Minimal<br />

<br />

Specification" on page 15-12<br />

"Publishing a Message Using a Topic Publisher—Specifying<br />

<br />

Priority and Time-To-Live" on page 15-18<br />

"Publishing a Message Using a Topic Publisher—Specifying a<br />

<br />

Recipient List Overriding Topic Subscribers" on page 15-21<br />

The publisher can set the message properties like delay and correlation before<br />

publishing.<br />

Syntax<br />

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

AQjmsTopicPublisher.publish()<br />

Example<br />

Example 1 - publish specifying delay, correlation<br />

TopicConnectionFactory tc_fact = null;<br />

TopicConnection t_conn = null;<br />

TopicSession jms_sess;<br />

TopicPublisher publisher1;<br />

Topic shipped_orders;<br />

int myport = 5521;<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_sess = t_conn.createTopicSession(true, Session.CLIENT_ACKNOWLEDGE);<br />

15-16 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

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

Saved successfully!

Ooh no, something went wrong!