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 Propagation<br />

Scheduling Propagation<br />

Remote database:<br />

database db2 - Western Shipping database.<br />

/* get messages for subscriber priority */<br />

public void get_priority_messages1(TopicSession jms_session)<br />

{<br />

Topic topic;<br />

TopicReceiver trecs;<br />

ObjectMessage obj_message;<br />

BolCustomer customer;<br />

BolOrder booked_order;<br />

try<br />

{<br />

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

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

"WS_bookedorders_topic");<br />

/* create a local receiver "Priority" for the remote subscription<br />

* to WS_bookedorders_topic<br />

*/<br />

trecs = ((AQjmsSession)jms_session).createTopicReceiver(topic, "Priority",<br />

null);<br />

obj_message = (ObjectMessage) trecs.receive();<br />

booked_order = (BolOrder)obj_message.getObject();<br />

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

System.out.println("Priority Order: for customer " +<br />

customer.getName());<br />

jms_session.commit();<br />

}<br />

catch (JMSException ex)<br />

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

}<br />

Propagation must be scheduled using the schedule_propagation method for<br />

every topic from which messages are propagated to target destination databases.<br />

A schedule indicates the time frame during which messages can be propagated<br />

from the source topic. This time frame may depend on a number of factors such as<br />

network traffic, load at source database, load at destination database, and so on.<br />

The schedule therefore has to be tailored for the specific source and destination.<br />

12-88 <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!