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:)

No comments:

Post a Comment

Featured Posts

Sample Real Time Assignment in Oracle SOA