Showing posts with label JMS. Show all posts
Showing posts with label JMS. Show all posts

Thursday, August 25, 2011

Create Distributed Queue in Oracle SOA 11g


Step1: Create the queues as the members of the distributed queue.
Assume there are 3 JMS server: SOAJMSServer_auto_2, SOAJMSServer_auto_3 and SOAJMSServer_auto_4.
Create 3 queues namely: qContentProvider1-2, qContentProvider1-3 and qContentProvider1-4. These queues are respectively targeted to the above 3 JMS servers.
Step2: Create the distributed queue.
Create the distributed queue: dist_ContentProvider1Queue in which the 3 queues created in Step1 are the members respectively.

Thursday, August 4, 2011

JMS Adapter Operation Types

Oracle SOA 11g JMS adapter provides 3 types of operations:
  1. Consume Message
  2. Produce Message
  3. Request/Reply
Consumer Message operation is used to receive inbound message from JMS destination. A receive activity is needed in the BPEL.

Produce Message operation is for sending outbound message into JMS destination. This operation is executed via BPEL invoke activity.

The third operation is Request/Reply. This operation involves two-way message flow: sending the request message to the JMS destination and receiving the response message from another JMS destination. The advantages of this operations is that you just need to configure one adapter for sending and receiving the messages and also the request and response correlation can be handled automatically by the adapter itself.

Request/Reply operation has two modes: synchronous and asynchronous. When using synchronous mode you just need to use invoke activity in your BPEL.



With asynchronous mode you need one invoke activity to send the request message and another activity: receive to receive the response message.

Throttling JMS message in JMS Adapter

Sometimes you need to throttle the JMS messages that will be processed by BPEL instances. For example you may need to consume the next message only after the BPEL instance finish the current message. You can achieve this by making one-way consume operation into two-way consume operation so the consume is not finished until a reply is generated. The next JMS message will consumed only after the processing of previous message is finished.

The original WSDL is like:

This added output message must be a empty message. So the modified WSDL will be as the below:


Tuesday, July 26, 2011

Use JmsAdapter in Oracle SOA 11g BPEL

In Oracle SOA 11g adapters are using JCA 1.5 specification to connect to the underlying resources such as JMS, database, file/ftp, sockets and etc.



There 3 steps to do in order to successfully use JmsAdapter to access the JMS destination in Oracle Bpel.


  • Add JmsAdapter into your Bpel in JDeveloper. Adding it is actually following the steps of Adapter Configuration Wizard.

Wizard Step 2: Give the service name to JMS Adapter.

Wizard Step 3: Select Oracle Weblogc JMS as JMS provider.



Wizard Step 4: Specify the application server for connection.

Wizard Step 5: Select to define from operation and schema as the adapter interface.

Wizard Step 6: This adapter is used to produce message.


Wizard Step 7: Specify the JMS destination and JNDI name for the connection factory.
Please note here: Destination name is the JNDI name for the destination used in normal JEE JMS resource.
And connection factory is the JNDI name used in JMS Adapter rather than JNDI in normal JEE JMS resource.



Wizard Step 8: Specify the schema for the payload of the JMS message.


After all wizard steps are finished, one .jca file is created where the connection factory and destination are specified.

  • Configure deployed JmsAdapter from Console to add outbound connection.

Click on Your domain/Deployments in Console and then select JmsAdapter.


Click on Configuration tab and then click on Outbound Connection Pools and then expand the group oracle.tip.adapters.jms.IJmsConnectionFactory.


Click the New button and select oracle.tip.adapters.jms.IJmsConnectionFactory.



Click on Next button and type in JNDI name for Outbound Connection Instance.
Please note here: This JNDI name should be the same as you specify in Wizard Step 7 when configuring Adapter in JDeveloper and then click on Finish button.


Modify the property of ConnectionFactoryLocation of this new created Outbound Connection.
Select your domain/Deployments/JmsAdaoter and then select Configuration tab and then expand oracle.tip.adpater.jms.IJmsConnectionFactory. Click on the new created Outbound connection: eis/wls/InventoryQueueConnectionFactory and then click on


Then type in the JNDI name of JMS connection factory as the value to the property: ConnectionFactoryLocation.


  • Configure physical JMS destination and connection factory in Oracle Weblogic Enterprise Manager.
Click on your domain/Services/Messaging/JMS Modules




Select KMS Module: SOAJMSModule.



Click on New Button to create the JMS destination.



Select the type of resource to be created as Queue and then click on Next button.



Type in the name of the physical queue and JNDI name for this queue and then click on Finish button.
Repeat the creation process to create the JMS connection factory.



Click on New button.



Select the type of resource to be created as Connection Factory and then click on Next button.


Type in the name for the queue connection factory and JNDI name for this connection factory.
Please note: This JNDI name should be the same as the value of the property
Finally click on Finish button.

  • Test the JMS message is sent to the queue.
After successfully running your BPEL one message should be sent to the queue. It can be verified using Console.
Click on your domain/Services/JMS Modules in Console and then click on SOAJMSModule.


Find your queue destination and click on it and then click on Monitoring tab.


And you will find there is one message in the queue destination. Select this queue and click on Show Messages to see the content of the message payload.


Click on the message ID and the content of the message is displayed.