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.

JMS Publish-Subscribe Model Features<br />

In the BooksOnline application, each shipping region receives messages from the<br />

corresponding booked orders topic (WS_bookedorder_topic or ES_<br />

bookedorder_topic). The local subscriber SUBS1 receives messages from the<br />

OE_booked_orders_topic.<br />

public void get_martins_orders(TopicSession jms_session)<br />

{<br />

Topic topic;<br />

TopicSubscriber tsubs;<br />

ObjectMessage obj_message;<br />

BolCustomer customer;<br />

BolOrder new_order;<br />

String state;<br />

int i=0;<br />

try<br />

{<br />

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

topic = ((AQjmsSession)jms_session).getTopic("OE",<br />

"OE_bookedorders_topic");<br />

/* Create local subscriber - to track messages for some customers */<br />

tsubs = jms_session.createDurableSubscriber(topic, "SUBS1",<br />

"JMSPriority < 3 AND Customer = ’MARTIN’",<br />

false);<br />

/* process 10 messages */<br />

for(i=0; i

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

Saved successfully!

Ooh no, something went wrong!