Consume message from JMS Adapter in SOA Suite 12C

In this example, we will discuss about the consuming message from JMS queue. This project will consume message from queue and write the message in the file. Follow the below steps to implement this example.

  1. Create a SOA project under same application. Right click on the application -> New Gallery -> General -> Projects -> SOA Project. Enter project name and select Composite With BPEL Process in the next wizardConsume_Message_JMS_Queue_1
  2. Click on Finish button and BPEL process wizard will open. Enter BPEL process name as ConsumeMsgBPELProcess and Define Service Later as template typeConsume_Message_JMS_Queue_2
  3. Select JMS Adapter from component palate and drag and drop it in the Exposed Services lane. JMS Adapter Configuration wizard will open. Enter service name as ConsumeMsg. Select Oracle Weblogic JMS as Oracle Enterprise Messaging Service and Integrated weblogic server as appserver connection in the next wizard.
  4. Select Consume Message as operation typeConsume_Message_JMS_Queue_3
  5. Select operation parameters like destination name and JNDI name of JMS connection pool like below screenshotConsume_Message_JMS_Queue_4
  6. Select the Employee.xsd schema file which is present in the configure folderConsume_Message_JMS_Queue_5
  7. Click on Next and then finish completing the JMD adapter configuration.
  8. Select File adapter from component palate and drag and drop it in the External References lane. File Adapter Configuration wizard will open. Enter reference name and select Write File as operation typeConsume_Message_JMS_Queue_6
  9. Click on Next button and enter the parameters like physical path for outgoing files and file naming convention as shown in the screenshotConsume_Message_JMS_Queue_7
  10. Click on Next button and create schema for file adapter. Click on cog icon beside the URL field. You can refer my article on file adapter to configure file adapter. You have to browse one sample file for creating schema. XML schema will created according to that sample file.Consume_Message_JMS_Queue_8
  11. Save the project and composite will look like below screenshotConsume_Message_JMS_Queue_9
  12. Double click on BPEL process and drag and drop Receive activity from component palate at the starting of the BPEL processConsume_Message_JMS_Queue_10
  13. Editor of Receive activity window will open. Enter name and select JMS adapter (ConsumeMsg) as partner link. Create a variable by clicking on green plus icon beside the Variable field.Consume_Message_JMS_Queue_11
  14. Click on OK buttonConsume_Message_JMS_Queue_12
  15. Drag and drop Invoke activity after receive activityConsume_Message_JMS_Queue_13
  16. Drags a wire from invoke activity to WriteMsg partner link. Editor of invoke activity will openConsume_Message_JMS_Queue_14
  17. Enter name of the invoke activity and create an input variable. Click on OK buttonConsume_Message_JMS_Queue_15
  18. Drag an Assign activity and drop it before the invoke activity. Double click on assign activity and do the mapping between input variables of receive activity and invoke activityConsume_Message_JMS_Queue_16
  19. Now BPEL process will look like thisConsume_Message_JMS_Queue_17
  20. Deploy the project in the integrated weblogic server
  21. Check the outgoing directory and a file will be created there with the employee details that is present in the queueConsume_Message_JMS_Queue_18
  22. Check the status of the queue in admin console. Navigate to Admin Console -> Services -> Messaging -> JMS Modules -> testJMSModule -> testQueue. It will give value 1 in the Consumers Total column.Consume_Message_JMS_Queue_19

These are some simple steps which will help you in consuming message from JMS queue.

Leave a Reply

Your email address will not be published. Required fields are marked *

Show my latest post here