In my previous example, we have discussed about the configuration of JMS connection pool. Now we will try here to publish message in JMS queue. All input data will be published in the testQueue using JMS connection pool (eis/jms/testConnectionPool). Find the below steps to publish message in JMS queue.
- Create a new application. Navigate to File -> New -> Application -> General -> Applications -> SOA Application. Enter the application name and click on Next button to create a SOA Project.
- Enter SOA project name and select Composite With BPEL process option in the next wizard
- Click on Finish button and BPEL process creation wizard will open. Enter BPEL process name and select Synchronous BPEL Process as template type. Select Employee.xsd file as input and output payload by clicking on glass icon. Import the schema file from local directory and then select the schema file.
- Click on OK button. Drag a JMS adapter from the component palate in the right swim lane (External Reference lane). This will open up the configuration window of JMS adapter. Enter the reference name.
- Click on Next button. Select Oracle Weblogic JMS as Oracle Enterprise Messaging Service from drop down list and Select Integrated Weblogic Server as appServer Connection as shown in the below screenshot
- Select Produce Message as Operation type
- Click on Next Browse Destination Queue name and JNDI name of JMS Connection pool from the available list
- Select the same employee schema in the next wizard.
- Now composite will look like this. Double click on BPEL process and do the necessary activity to produce message in queue.
- Drag and drop Invoke activity in between receiveInput and replyOutput
- Invoke Editor Window will open. Enter name of the invoke activity and select jms reference as partner link. Create input variable to hold the input value that will come from user. Click on OK button
- Drag an Assign activity and drop it before the Invoke activity. Double click on assign activity and map the input payload with the input variable of invoke activity
- Drag and drop another Assign activity after invoke activity
- Map the input payload with output payload in the second assign activity
- Now the BPEL process will look like below screenshot
- Deploy the project and test it in EM Console. Enter input values and click on Test web Service
- Navigate to Admin Console -> Services -> Messaging -> JMS Modules -> testJMSModule -> testQueue -> Select the message and then click on Show Messages
- Click the hyperlink on the ID column
- The message will be displayed in xml format. Match the message with output values in EM Console.
You can consume this produced message through SOA project. Refer my next article to consume message from JMS queue.