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.

Dequeue Features<br />

Rule-Based Subscription<br />

}<br />

m_property.setExceptionQueue("WS.WS_backorders_excpt_que");<br />

obj_payload = message.getObjectPayload();<br />

obj_payload.setPayloadData(back_order);<br />

enq_option = new AQEnqueueOption();<br />

/* Enqueue the message */<br />

enq_msg_id = back_order_q.enqueue(enq_option, message);<br />

db_conn.commit();<br />

}<br />

catch (Exception ex)<br />

{<br />

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

}<br />

Messages can be routed to various recipients based on message properties or<br />

message content. Users define a rule-based subscription for a given queue to specify<br />

interest in receiving messages that meet particular conditions.<br />

Rules are Boolean expressions that evaluate to TRUE or FALSE. Similar in syntax to<br />

the WHERE clause of a SQL query, rules are expressed in terms of the attributes that<br />

represent message properties or message content. These subscriber rules are<br />

evaluated against incoming messages and those rules that match are used to<br />

determine message recipients. This feature thus supports the notions of<br />

content-based subscriptions and content-based routing of messages.<br />

Subscription rules can also be defined on an attribute of type XMLType using XML<br />

operators such as ExistsNode.<br />

Scenario<br />

For the BooksOnLine application, we illustrate how rule-based subscriptions are<br />

used to implement a publish-subscribe paradigm utilizing content-based<br />

subscription and content-based routing of messages. The interaction between the<br />

Order Entry application and each of the Shipping Applications is modeled as<br />

follows:<br />

Western Region Shipping handles orders for the Western region of the U.S.<br />

8-86 <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!