How to Send messages using JMS Managed Adapter in Savvion
Savvion provides JMS Managed Adapters using which you can send or receive (or both). This tutorial aims at getting you started with configuring the JMS Adapter and sending messages using JMS Adapter.
Step 1: Identify your JMS Adapter configuration details
You will need to identify your JMS Connection factory and Queue name to which you want to send messages. Normally the connection factory that you can use (and which is preconfigured in Savvion) is
By default Savvion provides a queue called
which you can use to send receive messages. While you can use the admin console of your Applications server to create new Queues (Example jms/AbhiQueue) , care must be taken that if you want to consume these messages in some process using the JMS Managed adapter in receive mode, you will need to use the default queue “jms/JMSAdapterQueue” as the receive adapter listens to that Queue only.
Keep these two value handy. We will need them for configuring the Adapter.
Step 2: Add a JMS Adapter workstep to your process
Next, Add a JMS Adapter to your workstep. You can do that by adding a workstep and then choosing JMS Adapter from the Tasks Pane. Go to Assign Participants > Adapters > Managed > JMSAdapters > Generic JMS Adapter
Step 3: Add Dataslots which will store the Message payload
Now identify what data will flow into your JMS Message. The JMS Adapter supports what we call the “JMSMapMessage” which essentially contains key and values. Lets define three String dataslots “FullName”, “Address”, “UserId” which will store the values.
We will also define a dataslot called “RequestId” which will store our correlation id. Correlation id is like a primary key of the message. When you write code which will receive the message and process it, the correlation id can be used to identify what entity this message belongs to (example a user, customer etc).
Add these dataslots to the start workstep so that the user can specify the values. If your workflow is going to work mostly in a EAI mode you can get these values from another 3rd party system or a database.
Step 4: Configure Message Payload and properties
Next we will configure the properties of the adapter. Right click and see the properties. Click the “Configuration” Tab and click on “Configure”.
When you click on configure. The Next screen will ask you three things
- What is the mode you want to use the adapter. Choose Send Here
- What is the JMS Message Factory. Keep it as default
- What is the JMS Queue. Provide the Queue name you want to use
Now go to the tab “Outgoing message”. You will need to add the Payload properties here