|In this Mulesoft / Mule ESB tutorial we will connect with Tibco EMS server Queue and send messages across:|
|Mule JMS Connector
Inbound – Mule JMS will receive the message and be used with an inbound endpoint.
<jms:outbound-endpoint queue="my.queue"/>; <jms:inbound-endpoint topic="my.topic"/>;
Below are the steps:
|1. Connect to Tibco EMS Server
Make sure that you know the EMS Url, username and password and are able to connect to Tibco EMS server that you want your mule application to connect with.
Here we are using our local EMS server to connect, and queue “testq”.
|2. Importing EMS lib into Mule:
We need to import EMS java library into mule project to help connect the EMS server. If you are using a local EMS server to connect with, then you don’t need to download any of the libraries as you can find them in EMS installed location on your system (Go to: [ems installed folder]/[version]/lib).
|3. Creating the flow:
In this Mule example we will read the content from a file and post that content to a JMS queue “testq”.
|4. Configure Mule File Connector:
Configure input directory and output directory.
|5. Configure Mule JMS Connector:
In advanced tab, Initial Factory will always be same “com.tibco.tibjms.naming.TibjmsInitialContextFactory”, specify Provider URL and Connection Factory as per your EMS server.
|6. Run the Mule Application
If connections details provided are correct then the mule application will read the file in the input folder and JMS will send the message to “testq” queue.
Here’s how the mule code will look like in configuration XML
[xhtml] <jms:connector name=”TibJMS” validateConnections=”true” jndiProviderUrl=”tcp://localhost:7222″ jndiInitialFactory=”com.tibco.tibjms.naming.TibjmsInitialContextFactory” doc:name=”JMS” connectionFactoryJndiName=”QueueConnectionFactory” persistentDelivery=”true” username=”admin” password=”admin”/>;