Publish Message to JMS Queue

This post takes you through a step-by-step procedure to create a JMSAdapter that publishes a message

1. Create a new SOA Project 
2. Define a message schema of the following type

3. Drag and drop JMSAdapter from the component palette to References section of composite.xml 
4. Configure the JMSAdapter as per the screenshots given below

The below wizard is important
Select the Queue where the message is to be published(which is created in previous tutorial)
Set the TimeToLive property whose meaning is obvious. The message disappears after this time
Also, set the JNDI name of the ConnectionPool that you’ve created in the previous tutorial


Your composite would look like this
5. Create a one-way Mediator with the input type similar to the one for JMSAdapter(with SOAP endpoint) and wire it to the JMSAdapter

6. Composite looks like this

7. Now, open the mediator, create the transformation file in the Routing Rule and deploy

Testing
Open the composite in EM and test it (give a payload of your choice)

To check if the message is published to JMS,
Goto Services –> Messaging –> JMS Modules –> MyJMSModule –> myQueue –> Monitoring tab –> click on the Queue name –> Show Messages –> click on the message

This message stays in the queue for the time that is configured in the wizard. After that time, the message expires.

This entry was posted in Uncategorized. Bookmark the permalink.

1 Response to Publish Message to JMS Queue

  1. Venkatesh Lu says:

    Hi what will happen when the consumer is not available to the requested queue? where will this file go?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s