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.

{<br />

}<br />

/* cast to JMS Object Message */<br />

obj_msg = (ObjectMessage)m;<br />

JMS Message Consumer Features<br />

/* Print some useful information */<br />

new_order = (BolOrder)obj_msg.getObject();<br />

customer = new_order.getCustomer();<br />

System.out.println("Order: for customer " + customer.getName());<br />

/* call the update status method<br />

* NOTE: we are assuming it is defined elsewhere<br />

*/<br />

update_status(new_order, new_order.getStatus());<br />

/* commit the asynchronous receipt of the message */<br />

the_sess.commit();<br />

}catch (JMSException ex)<br />

{<br />

System.out.println("Exception: " + ex);<br />

}<br />

}<br />

public void monitor_status_topics(TopicSession jms_session)<br />

{<br />

Topic[] topic = new Topic[4];<br />

TopicSubscriber[] tsubs= new TopicSubscriber[4];<br />

try<br />

{<br />

/* get a handle to the OE_bookedorders_topic */<br />

topic[0] = ((AQjmsSession)jms_session).getTopic("CS",<br />

"CS_bookedorders_topic");<br />

tsubs[0] = jms_session.createDurableSubscriber(topic[0], "BOOKED_ORDER");<br />

topic[1] = ((AQjmsSession)jms_session).getTopic("CS",<br />

"CS_billedorders_topic");<br />

tsubs[1] = jms_session.createDurableSubscriber(topic[1], "BILLED_ORDER");<br />

topic[2] = ((AQjmsSession)jms_session).getTopic("CS",<br />

"CS_backdorders_topic");<br />

tsubs[2] = jms_session.createDurableSubscriber(topic[2], "BACKED_ORDER");<br />

topic[3] = ((AQjmsSession)jms_session).getTopic("CS",<br />

"CS_shippedorders_topic");<br />

Creating Applications Using JMS 12-79

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

Saved successfully!

Ooh no, something went wrong!