SOA 11g Tutorial: JMS Adapter

 

This is part of the Oracle SOA11g hands on tutorials.

JMS Adapter

Overview

* Supports both one-way and request-response interactions
* Supports byte, text, map messages
* XA-capable
* Certified with most JMS providers
– Oracle WebLogic JMS
– Oracle AQ JMS
– TIBCO EMS
– IBM WebSphere MQSeries
– Apache JMS
– Actice MQ

Add JMS Adapter to Composite

Add USPS JMS Adapter

* Open composite.xml
* Drag and drop a JMS Adapter to the External References swim lane
* Name the service: JMS_USPS, click Next
* On JMS Provider dialog, select OEMS -> Oracle Weblogic JMS, click Next
* On Service Connection dialog, select MyAppServerConnection, click Next
* On Adapter Interface dialog, select Define from operation and schema (specified later), click Next
* On Operation dialog, select Product Message, click Next
* On Produce Operation Parameters,
– browse Destination Name (Queue) and select demoFulfillmentQueue
– specify JNDI Name: eis/Queue/demo
– click Next
* On messages dialog,
– click the magnifying glass and browse to Fulfillment.xsd -> Filfillment, click OK
– click Next
* Click Finish

Add USPS JMS Adapter

* Repeat and name the service: JMS_UPS, click Next

Add USPS JMS Adapter

* Repeat and name the service: JMS_FedEx, click Next

Wire FulfillmentProcess and JMS Adapters

* Drag wires to connect FulfillmentProcess to each of the three JMS Adapters

* Save All

Invoking Services from BPEL

* Double click FulfillmentProcess to open FulfillmentProcess.bpel editor
* Drag and drop a Switch activity below the Business Rule icon
* Right click the switch icon and select Add switch case
* Repeat to add another switch case
* Right click otherwise switch lane and select delete

Setup USPS Case

* Click first condition, set the name to USPS
* Select Expression Builder icon, set condition expression to:

bpws:getVariableData('outputVariable','payload','/ns2:CarrierSelection/ns2:carrier') = 'USPS'

Setup USPS Case

* Click first condition, set the name to UPS
* Select Expression Builder icon, set condition expression to:

bpws:getVariableData('outputVariable','payload','/ns2:CarrierSelection/ns2:carrier') = 'UPS'

Setup USPS Case

* Click first condition, set the name to FedEx
* Select Expression Builder icon, set condition expression to:

bpws:getVariableData('outputVariable','payload','/ns2:CarrierSelection/ns2:carrier') = 'FedEx'

Invoke Services

* Drag and drop an Invoke activity onto USPS switch lane
* Drag a wire from newly added Invoke to JMS_USPS partner link
– Name it Invoke_USPS
– Create an Input variable using default value
– Click OK
* Repeat for UPS and FedEx switches

Assign Input Variables

* Drag and drop an Assign activity into the first switch case above the Invoke acitivity
* Double click Assign activity
– Create a copy operation
From
inputVariable/payload//ns2:Fulfillment
To
Invoke_USPS_produce_Message_InputVariable/body//ms2:Fulfillment
– Click OK
* Repeat for the other two services
* Save all

Deploy

* Deploy as usual

Test

* Test small, large, extra large orders as in business rules post

View JMS Message

* Login WebLogic Admin Console
* On upper left Domain Structure pane, click Services -> Messaging -> JMS Modules
* On right pane, click SOA JMSModule
* Click demoFulfillmentQueue
* Click Monitoring tab
* Check checkbox for the message you want to view and click Show Messages button
* Click ID:xxx to view the message details

This entry was posted in soa11g. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.