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.

Message Transformation with JMS AQ<br />

Example Scenario<br />

In the BooksOnLine example, we will consider the order entry and shipping<br />

applications. For these examples, we will use topics with ADT type payloads.<br />

Example Code<br />

Assume that the Order entry topic OE.OE_bookedorders_topic has a payload<br />

of type OE.OE_ORDER.<br />

create or replace TYPE OE_order as OBJECT (<br />

orderno NUMBER,<br />

status VARCHAR2(30),<br />

ordertype VARCHAR2(30),<br />

orderregion VARCHAR2(30),<br />

customer CUSTOMER_TYP,<br />

paymentmethod VARCHAR2(30),<br />

creditcard# VARCHAR2(30);<br />

items ORDERITEMLIST_VARTYP,<br />

order_date DATE,<br />

total NUMBER);<br />

The Western Shipping topic WS_bookedorders_topic has payload of type<br />

WS.WS_ORDER:<br />

create or replace TYPE WS_Order AS OBJECT (<br />

customer_name VARCHAR2(100),<br />

address VARCHAR2(1000),<br />

city VARCHAR2(1000),<br />

state VARCHAR2(1000),<br />

country VARCHAR2(1000),<br />

zipcode VARCHAR2(1000),<br />

orderno NUMBER,<br />

status VARCHAR2(30),<br />

ordertype VARCHAR2(30),<br />

items ORDERITEMLIST_VARTYP,<br />

order_date VARCHAR2(10));<br />

The java classes (that implement the CustomDatum interface) can be generated for<br />

these types using the Jpublisher utility.<br />

We will define a transformation that defines the mapping from OE.OE_Order to<br />

WS.WS_ORDER as:<br />

execute dbms_transform.create_transformation(<br />

schema => ’OE’,<br />

name => ’OE2WS’,<br />

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