Oracle SOA Suite - BPEL to JMS JDeveloper Project
By malkit on Sep 22, 2010
Sharing my quick notes on steps to create and test a JMS Project. Thought it might be useful for someone who is starting on Oracle SOA Product, part of Fusion Middle-ware. We will create a synchronous bpel process that exposes soap endpoint and then writes (invoke) the input message to a queue in the middle of business process and echoes the input message back the client using reply activity.
We will use Oracle JDeveloper and Weblogic server for the runtime. Before we create the process in jdeveloper, we will first configure the JMS Queue in Weblogic server. Here are the steps.
Create JMS Queue and ConnectionFactory
- Start Weblogic server and log on to the console (http://localhost:7001/console/)
- In the Domain Structure tree on left, expand Service then click ‘JMS Modules’ (Figure 1)
- Click SOAJMSModule (for development purposes, you can also create a new Module also) and then click ‘New’ button.
- On the opened page, select ‘Queue’ radio button and click ‘Next’
- Specify queue name (say queueout) and JNDI Name (say, jms/queuein) and click ‘Next’
- Optional – for Sub-deployment, select ‘SOA Subdeployment’ and target keep the default. Click ‘Finish’ (Figure 2)
- Follow above steps and create Connection Factory (select Connection Factory for step d and specify jndi name, say jms/jmstest-cf)
Create Connection Pool
- Click ‘Deployments’ from the Domain Structure and then click JmsAdapter (Figure 3)
- Select ‘Configuration’ tab and ‘Outbound’ sub-tab and then click ‘New’ (Figure 4)
- Select existing ‘oracle.tip.adapter.jms.IJmsConnectionFactory’ radio button and click ‘Next’ (Figure 5)
- Specify JNDI Name, say jmstest/jmstest-cp and click ‘Finish’.
- Expand ‘oracle.tip.adapter.jms.IJmsConnectionFactory’ to verify and configure the newly created connection pool.
- Click the Property Value column for ConnectionFactoryLocation row and enter the connection factory value. Press enter to accept the value. Click ‘Save’ to save the value. (Figure 6)
Create JDev Project
- Open JDev and create a SOA Project. Select ‘Composite with BPEL Process’ Option.
- For BPEL Process, select Synchronous Project.
- Double click the composite and drag and drop JMS Adapter to the right swim lane (External Reference)
- Configure the JMS Wizard – enter name, select Oracle Weblogic JMS, specify app server connection, specify operation type (Produce Message, in our case), browse the queue and specify the connection factory jndi. (Figure 7)
- For the Step 8 of JMS Adapter Configration wizard, click the browse button to point to the xsd for the schema for the message to the queue (Figure 8).
- Upon completion of wizard, you will see JMS Outbound reference on composite. Also, JCA configuration file (
_jms.jca) will with adapter configuration will be created. Connection the BPEL Process to the outbound reference created in above step. (Figure 9). Go to BPEL Process and drop assign, invoke and another assign activity between receive and reply activity. Double click invoke and browse partnerlink and pick the outbound_jms partnerlink. Create new variable for the invoke activity. Configure the first assign to copy the input to invoke variable. Also configure the second assign to copy the input to output variable. Build and deploy the application.
Testing the Application
- Open the Enterprise Manager (http://localhost:7001/em)
- Expand SOA Node from left tree and click the deployed project. On the main page click ‘Tab’
- Enter input message and click ‘Test Web Service’ (Figure 10). Click respose tab to verify the response.
- To view the message to the queue, go back to the weblogic console ((http://localhost:7001/console/). Navigate to Services -> Messaging -> JMS Modules -> SOAJMSModule -> queueout. Click on Monitoring tab and select the queue and press ‘Show Messages’.