Showing posts with label Oracle SOA. Show all posts
Showing posts with label Oracle SOA. Show all posts

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

Wednesday, August 5, 2020

Pushing Request to queue using JMS adapter in SOA 12c

Hello everyone! In this post, I'm going to show you how we use jms adapter to publish a message to queue in SOA 12c. So lets get started.


1. Create a SOA project with empty composite.


Drag and drop a BPEL with Synchronous interaction Type. Check the check box "Expose as a SOAP service". You can create a schema with input and output variables or you can just leave them as default.


2. Drag and drop a JMS adapter to the External Services side. give it a suitable name and click Next.


Select the Messaging service and click Next..


Select your connection and click Next.


Select the Interface as "Specified later".


Select the Operation Type as Produce Message.


Browse your Queue JNDI for "Destination Name(Queue)" and give the correct JNDI name for "JNDI Name" value which is your actual JMS JNDI. Don't get confused this with queue JNDI.


In the next screen, browse the schema by clicking on highlighted magnifier icon.


Select your BPEL input from XSD schema.


Click Next.


Click Finish.


Wire the BPEL  to JMS adapter.


3. Edit the BPEL and drag and drop an Invoke activity to invoke the JMS adapter. Select the JMS partner link and create an input variable.


Now, drag and drop an Assign activity just after Receive activity to map the BPEL input to Invoke Input variable. Click Apply and click OK.


Drag and drop another Assign activity after Invoke. Add a custom message to BPEL output variable. Click Apply and then OK.


Your final composite should look like below. Now deploy your service to test it.


Enter something in the Request payload.


You'll see the Response as below.



5. Now, we need to check the JMS queue if the message has been published to the queue. Got to weblogic console page. Click on Service>Messaging>JMS Modules.


Click on your JMS Module.


Click on your queue which you gave in JMS adapter configuration.


Go to Monitoring.


Check the check box and click on "Show Messages".


Click on the Message ID to view the message.


And here is your message that is published to queue.


Happy learning and Cheers:)

Featured Posts

Sample Real Time Assignment in Oracle SOA