KB Article #182777

JMS: Using the ST JMS Connector with RabbitMQ

Problem

Set up the SecureTransport JMS Plugin to work with RabbitMQ.


Resolution

Perform the following steps in order to setup the plugin correctly.


1. Download and install the SecureTransport JMS Plugin following the installation instruction in its Readme file.


2. Download and copy the following RabbitMQ jar files from their Maven Repositories (the exact versions).


  • amqp-client-5.16.0.jar
  • rabbitmq-jms-2.8.0.jar
  • javax.jms-api-2.0.1.jar
  • fscontext-4.4.2.jar


You can find the dependancy configuration in the following URLs:

https://mvnrepository.com/artifact/javax.jms/javax.jms-api/2.0.1

https://mvnrepository.com/artifact/com.rabbitmq/amqp-client/5.16.0

https://mvnrepository.com/artifact/com.rabbitmq.jms/rabbitmq-jms/2.8.0

https://mvnrepository.com/artifact/com.sun.messaging.mq/fscontext/4.4.2


3. Copy the above 4 jar files into $FILEDRIVEHOME/plugins/transferSites/axway-site-jms/1.7/lib/external/.


4. Follow the instructions in KB 181827 to create the $FILEDRIVEHOME/conf/safe-deserialization.txt file.


5. Add


com.rabbitmq.**


to the $FILEDRIVEHOME/conf/safe-deserialization.txt file.


6. Restart ST


7. Create a .bindings (the name must be exact) file for RabbitMQ in a folder of your choice (suggested place is $FILEDRIVEHOME/plugins/transferSites/axway-site-jms/1.7/lib). Example contents of the file:


#Connection Factory Object
ConnectionFactory/ClassName=javax.jms.ConnectionFactory
ConnectionFactory/FactoryName=com.rabbitmq.jms.admin.RMQObjectFactory
ConnectionFactory/RefAddr/0/Content=jms/ConnectionFactory
ConnectionFactory/RefAddr/0/Type=name
ConnectionFactory/RefAddr/0/Encoding=String
ConnectionFactory/RefAddr/1/Content=javax.jms.ConnectionFactory
ConnectionFactory/RefAddr/1/Type=type
ConnectionFactory/RefAddr/1/Encoding=String
ConnectionFactory/RefAddr/2/Content=com.rabbitmq.jms.admin.RMQObjectFactory
ConnectionFactory/RefAddr/2/Type=factory
ConnectionFactory/RefAddr/2/Encoding=String
# Change this line accordingly
ConnectionFactory/RefAddr/3/Content=<rabbitMq_host>
ConnectionFactory/RefAddr/3/Type=host
ConnectionFactory/RefAddr/3/Encoding=String


8. Create a JMS Transfer Site and provide the path to the folder with the .bindings file in the JNDI Configuration field as follows:


java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
java.naming.provider.url=file:/<path_to_bindings_folder>