Wednesday, August 12, 2020

Consuming JMS message from a queue in SOA 12c

Hi! Hope everyone id doing well. Today, I'm going to show you how to consume a message from JMS queue in Oracle SOA 12c. To consume a message from the queue, first a message should be published to JMS queue. To publish a message, click here to navigate to my previous post that shows how to push a request to queue.

1. Create a SOA Project.


2. Drag and drop a JMS adapter to the Exposed Services swim lane. Give it a proper name or leave default and click Next.


Select the JMS Provider and click Next.


Select your connection and click Next.


Leave the default interface as specified later and click Next.


Select the Operation Type as Consume Message. Click Next.


Specify the Destination Name as the queue where your message lies and select the correct JNDI name.


Select the schema input message. Here, I copied the schema that I used in Publish message jms service. Click here to navigate to that publish message post.


Click Finish in the next screen.

3. Drag and drop a BPEL with Interface Type as "No Service".


Wire the BPEL to JMS Service.


Edit the BPEL and drag and drop a Receive activity. Check the check box "Create Instance". Select the Partner link as JMS Service and create a variable by clicking on green plus(+) icon. Click Apply and click OK.


As we just want to consume message, we've added only receive activity. If you want to insert the consumed data into a table, you can use a database adapter and map the values to insert the values.


Now, deploy your service. Click on the Flow Instances and Click on the Search button to see the created instances. Click on the instance id to see the flow.


Click on the ConsumeMsgBPELProcess and open Receive activity to see the consumed message.


Hope this post helped you. If you have any queries, hit them in the comment section below. Happy learning. Cheers!!

Tuesday, August 11, 2020

Pick Activity in Oracle SOA 12c

Hi! In this post, I'm going to show you how we use pick activity in Oracle SOA. Pick activity can be used to pick specific operations or pick specific services. this post will show you how to use pick activity to pick a specific operation. Let's get started.

Here, I want to have two operations Square and Cube that should give the square and cube of a number  respectively.

1. Create a SOA project. Drag and drop a BPEL. Select the operation as No Service.


Drag and drop a SOAP adapter to the Exposed Services swim lane. Click on the highlighted icon to create a wsdl with two operations if you don't have one.


Select the interface type as Synchronous Interface. Give Operation as Square and create Input and Output variables with integer type.


Modify your WSDL to add one more operation as Cube. Your final wsdl should look like this.


My WSDL source looks like this.



Now wire the BPEL to SOAP service and select the transaction as notSupported.


Edit the BPEL and drag and drop a Pick activity from components pane.


Click on the Pick operation that is just above OnMessage and check the checkbox "Create Instance". Click Apply and click OK.


Click on the OnMessage and select the partner link as SOAP service that we created and select the operation as Square. Create an input variable and click Apply and then OK.


Drag and drop a Reply activity and drag it towards the partner link and select the operation as Square. Create a variable by clicking on green plus(+) icon. Click Apply and click OK.



Drag and drop an Assign activity and click on the Reply Square output variable and add the expression as below.

$OnMessage_Square_InputVariable.Input * $OnMessage_Square_InputVariable.Input


Now do the same steps for cube operation as well.

On Message for cube operation:


Cube operation Reply activity:


In the cube Assign activity, multiple the input variable thrice as below.


After doing the above steps, your composite should look like below.


Now deploy your application and test it by selecting Square operation under Operation.




Your'll see the response as below.


Similarly, test the service with Cube operation.


You'll see the response as cube of the number you entered.


Happy learning SOA. Cheers!!

Featured Posts

Sample Real Time Assignment in Oracle SOA