This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

This section describes how to configure WSO2 Enterprise Integrator (WSO2 EI) JMS inbound protocol with ActiveMQ.

Follow the instructions below to set up and configure Apache ActiveMQ as the JMS server:

  1. Download and set up Apache ActiveMQ. For more information, see Installation Prerequisites
  2. Set up WSO2 EI. For information on getting the WSO2 EI set up, see Installation Guide.

    Note

    ActiveMQ should be up and running before starting WSO2 EI.

  3. Copy the following client libraries from the <AMQ_HOME>/lib directory to the <EI_HOME>/lib directory.

    For ActiveMQ 5.8.0 and above

    • activemq-broker-5.8.0.jar
    • activemq-client-5.8.0.jar
    • geronimo-jms_1.1_spec-1.1.1.jar
    • geronimo-j2ee-management_1.1_spec-1.0.1.jar

    Note

    If you are using ActiveMQ version 5.8.0 or later, copy hawtbuf-1.2.jar to the <ESB_HOME>/repository/components/lib directory.

    For earlier versions of ActiveMQ

    • activemq-core-5.5.1.jar
    • geronimo-j2ee-management_1.0_spec-1.0.jar
    • geronimo-jms_1.1_spec-1.1.1.jar
  4. Next,  configure the inbound listener in the ESB.

Configuring the JMS inbound listener

Following is a sample JMS inbound listener configuration:

<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse" name="jms" sequence="request" onError="fault" protocol="jms" suspend="false">
      <parameters>
         <parameter name="interval">1000</parameter>
         <parameter name="transport.jms.Destination">ordersQueue</parameter>
         <parameter name="transport.jms.CacheLevel">1</parameter>
         <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
         <parameter name="sequential">true</parameter>
         <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
         <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
         <parameter name="transport.jms.SessionAcknowledgement">AUTO_ACKNOWLEDGE</parameter>
         <parameter name="transport.jms.SessionTransacted">false</parameter>
         <parameter name="transport.jms.ConnectionFactoryType">queue</parameter>
      </parameters>
   </inboundEndpoint>

Note

For details on the JMS configuration parameters used in the sample configuration above, see JMS Connection Factory Parameters.

The sample configuration above does not address the problem of transient failures of the ActiveMQ message broker. For example, if we consider a scenario where the ActiveMQ broker goes down for some reason and comes back up after a while, WSO2 EI will not reconnect to ActiveMQ but instead it will throw errors when requests are sent to WSO2 EI until it is restarted.
In order to tackle this issue you need to specify the following as the java.naming.provider.url parameter value.

failover:tcp://localhost:61616

Setting this as the value for the java.naming.provider.url parameter will make sure that re-connection takes place when ActiveMQ is up and running. The failover prefix is associated with the failover transport of ActiveMQ. For more information, see Failover Transport.

Now you have an instances of ActiveMQ and WSO2 EI inbound endpoint configured, up and running.    

 

  • No labels