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.

Specifying a Message Listener to Receive a Message Asynchronously at the Message Consumer<br />

See Also:<br />

Purpose<br />

Specify a Message Listener at the Message Consumer<br />

Usage Notes<br />

Not applicable.<br />

Table 16–1 for a list of basic operations in the JMS shared<br />

<br />

operational interface<br />

"Interface - javax.jms.MessageConsumer" on page B-29<br />

"Specifying a Message Listener to Receive a Message<br />

<br />

Asynchronously at the Session" on page 16-58<br />

Syntax<br />

See Chapter 3, "AQ Programmatic Environments" for a list of available functions in<br />

each programmatic environment. Use the following syntax references for each<br />

programmatic environment:<br />

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

AQjmsConsumer.setMessageListener<br />

Examples<br />

See Chapter 3, "AQ Programmatic Environments" for a list of available functions in<br />

each programmatic environment.<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 />

MessageListener mLis = null;<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 />

shipped_orders = ((AQjmsSession )jms_sess).getTopic("WS",<br />

"Shipped_Orders_Topic");<br />

16-56 <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!