Skip to end of metadata
Go to start of metadata

Introduction

By default, the Jitterbit Harmony JMS Connector establishes access to JMS using ActiveMQAdditional JMS providers can also be used. This page summarizes how to establish access to JMS using RabbitMQ.

NOTE: A RabbitMQ provider can be used only with projects that use Jitterbit Harmony Private Agents.

Prerequisites

These JAR files must be downloaded onto your Private Agent: 

A .bindings file must be created with these contents: 

.bindings
# Define the 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

# Define the location of the broker, likely localhost, and the VirtualHost these resources will reside in
ConnectionFactory/RefAddr/3/Content=13.65.205.254
ConnectionFactory/RefAddr/3/Type=host
ConnectionFactory/RefAddr/3/Encoding=String

# If no ack is received in 1 minute(milliseconds) then message is requeued
ConnectionFactory/RefAddr/4/Content=60000
ConnectionFactory/RefAddr/4/Type=onMessageTimeoutMs
ConnectionFactory/RefAddr/4/Encoding=String

# Receive one message at a time
ConnectionFactory/RefAddr/5/Content=1
ConnectionFactory/RefAddr/5/Type=channelsQos
ConnectionFactory/RefAddr/5/Encoding=String

# Define an example Queue
queue1/ClassName=javax.jms.Queue
queue1/FactoryName=com.rabbitmq.jms.admin.RMQObjectFactory
queue1/RefAddr/0/Content=jms/Queue
queue1/RefAddr/0/Type=name
queue1/RefAddr/0/Encoding=String
queue1/RefAddr/1/Content=javax.jms.Queue
queue1/RefAddr/1/Type=type
queue1/RefAddr/1/Encoding=String
queue1/RefAddr/2/Content=com.rabbitmq.jms.admin.RMQObjectFactory
queue1/RefAddr/2/Type=factory
queue1/RefAddr/2/Encoding=String
queue1/RefAddr/3/Content=queue1
queue1/RefAddr/3/Type=destinationName
queue1/RefAddr/3/Encoding=String

Enabling RabbitMQ with JMS

Follow these steps to enable RabbitMQ with JMS:

  1. Go to your Jitterbit Agent directory: <JITTERBIT_HOME>/Connectors/JMS, replacing <JITTERBIT_HOME> with your Private Agent root directory. Your Private Agent root directory is usually in one of these default locations: 

    • Windows: C:\Program Files (x86)\Jitterbit Agent\
    • Linux: /opt/jitterbit

    Add these entries to JMS_ProviderInfo_User.conf:

    Windows
    <Provider>
    <Name>RabbitMQ</Name>
    <java.naming.factory.initial>com.sun.jndi.fscontext.RefFSContextFactory</java.naming.factory.initial>
    <java.naming.provider.url>file:///C:/Program Files (x86)/Jitterbit Agent/Connectors/JMS/Providers/RabbitMQ</java.naming.provider.url>
    <factoryName>ConnectionFactory</factoryName>
    <pathOfProviderJars>C:\Program Files (x86)\Jitterbit Agent\Connectors\JMS\Providers\RabbitMQ</pathOfProviderJars>
    </Provider>	
    Linux
    <Provider>
    <Name>RabbitMQ</Name> 
    <java.naming.factory.initial>com.sun.jndi.fscontext.RefFSContextFactory</java.naming.factory.initial>
    <java.naming.provider.url>file://localhost/opt/jitterbit/Connectors/JMS/Providers/RabbitMQ</java.naming.provider.url>
    <factoryName>ConnectionFactory</factoryName>
    <pathOfProviderJars>/opt/jitterbit/Connectors/JMS/Providers/RabbitMQ</pathOfProviderJars>
    </Provider>

    NOTE: These entries should be placed at the bottom of JMS_ProviderInfo_User.conf between the arrow -->  and </Providers>.

  2. Navigate to Jitterbit Agent > Connectors > JMS > Providers. In the Providers directory, create a new folder named RabbitMQ. To this folder add the .bindings file and JAR files listed in Prerequisites
  3. Restart the agent: 

  4. Once the agent is running, you will be able to create a new JMS endpoint with the option to select RabbitMQ as the provider:

          

For more information on creating JMS endpoints, see JMS Connector Creating Endpoints

  • No labels