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

When a schedule is created, a job is automatically submitted to the job_queue<br />

facility to handle propagation.<br />

The administrative calls for propagation scheduling provide great flexibility for<br />

managing the schedules (see "Scheduling a Queue Propagation", Chapter 9,<br />

"Administrative Interface"). The duration or propagation window parameter of a<br />

schedule specifies the time frame during which propagation has to take place. If the<br />

duration is unspecified then the time frame is an infinite single window. If a<br />

window has to be repeated periodically then a finite duration is specified along<br />

with a next_time function that defines the periodic interval between successive<br />

windows.<br />

The latency parameter for a schedule is relevant only when a queue does not have<br />

any messages to be propagated. This parameter specifies the time interval within<br />

which a queue has to be rechecked for messages. Note that if the latency parameter<br />

is to be enforced, then the job_queue_interval parameter for the job_queue_<br />

processes should be less than or equal to the latency parameter. The propagation<br />

schedules defined for a queue can be changed or dropped at anytime during the life<br />

of the queue. In addition there are calls for temporarily disabling a schedule<br />

(instead of dropping the schedule) and enabling a disabled schedule. A schedule is<br />

active when messages are being propagated in that schedule. All the administrative<br />

calls can be made irrespective of whether the schedule is active or not. If a schedule<br />

is active then it will take a few seconds for the calls to be executed.<br />

Job queue processes must be started for propagation to take place. At least 2 job<br />

queue processes must be started. The dblinks to the destination database must also<br />

be valid. The source and destination topics of the propagation must be of the same<br />

message type. The remote topic must be enabled for enqueue. The user of the<br />

dblink must also have enqueue privileges to the remote topic.<br />

Example Code<br />

public void schedule_propagation(TopicSession jms_session)<br />

{<br />

Topic topic;<br />

try<br />

{<br />

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

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

"WS_bookedorders_topic");<br />

/* Schedule propagation immediately with duration of 5 minutes and latency<br />

20 sec */<br />

Creating Applications Using JMS 12-89

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

Saved successfully!

Ooh no, something went wrong!