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/.

ESB and Apache Qpid

http://wso2.org/library/knowledge-base/2010/11/wso2-esb-apache-qpid-setup-guide

This Guide explains how to setup WSO2 ESB and Apache Qpid from scratch. This Guide does not contain any internal message flow configurations of ESB. In this setup, as the first step, WSO2 ESB (ESB1) is forwarding messages that come to the Proxy, to Apache Qpid. Once messages come to a particular queue, WSO2 ESB (ESB2) picks them from Apache Qpid and forwards it to some endpoint.

1. Download Apache Qpid from here http://www.apache.org/dist/qpid/0.6/qpid-java-0.6.tar.gz. Extract and open the QPID_HOME/etc/config.xml change enable ssl false as below.

<management>
<enabled>true</enabled>
<jmxport>8999</jmxport>
<ssl>
<enabled>false</enabled>
<\!-\- Update below path to your keystore location, eg ${conf}/qpid.keystore \-->
<keyStorePath>${prefix}/../test-profiles/test_resources/ssl/keystore.jks</keyStorePath>
<keyStorePassword>password</keyStorePassword>
</ssl>
</management>
<port>5673</port>
<sslport>8673</sslport>

Note

If you are going to use Apache Qpid C++ broker, download the broker from http://www.apache.org/dist/qpid/0.6/qpid-cpp-0.6.tar.gz, refer the INSTALL file, build it in your platform and start Qpid Java broker with the following command

QPID_HOME/sbin/qpidd \--auth no

2. If you want to use Apache Qpid in a clustering mode and extract another Apache Qpid instance, do step 1 and edit QPID_HOME/etc/config.xml and change the ports configuration by editing port and sslport elements.

3. Start Apache Qpid by running QPID_HOME/bin/qpid-server. If you are using a cluster start all the instances.

Configuring WSO2 ESB Instance that Forwards Incoming Messages to Apache Qpid Instance

1. Create a server.properties file in CARBON_HOME/repository/conf/ directory and add the following entries to the properties file.

connectionfactory.qpidConnectionfactory=amqp://guest:guest@clientid/test?brokerlist='tcp://10.3.24.99:5672'
destination.directQueue=direct://amq.direct//ServiceName
destination.replyQueue =direct://amq.direct//ServiceNameReply

In this configuration "10.3.24.99" is the IP address of the machine which Apache Qpid is running and qpidConnectionfactory is a reference we are using for our reference in axis2.xml.

If you are using Apache Qpid in a cluster, create another properties file and define the same configuration with a different file name. Let's assume your slave configuration file is server1.properties.

2. Now open the CARBON_HOME/repository/conf/axis2.xml and add the following entry:

Adding transportRecievers
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.apache.qpid.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">/home/wso2/WSO2_SETUP1/wso2esb-3.0.0/repository/conf/server.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">qpidConnectionfactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> </parameter>
<parameter name="slave" locked="false">
<parameter name="java.naming.factory.initial"
locked="false">org.apache.qpid.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">/home/wso2/WSO2_SETUP1/wso2esb-3.0.0/repository/conf/server1.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">qpidConnectionfactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
</transportReceiver>

Tip

Change the java.naming.privider.url element according to your setup.

Adding transportSenders
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>

3. If you need only one Apache Qpid instance, remove the second parameter list and keep the default configuration (parameter set with name="default") and note the name of the second parameter set is "slave." You need to use that configuration to be added in to synapse configuration when we configure failover endpoints.

4. Copy following JARs in to CARBON_HOME/repository/components/lib directory and download the merged jar from the given location. The rest of the JARs can be found in QPID_HOME/lib directory.

5. Start the WSO2 ESB instance by running CARBON_HOME/bin/wso2server.sh or BAT file, now it will connect to the Apache Qpid instance running successfully.

Configuring ESB Instance Which Picks Incoming Messages from Apache Qpid and Forward them to the Actual Service

Perform all the steps from step 1-5 in the WSO2 ESB in main setup where we call the MemberVerification service directly. This ESB instance has to be configured with Apache Qpid to pick messages from the queues and send the request to the actual service, and once the response comes back, put the response in to the reply queue defined in server.properties file.

But in the server.properties file you do not need to add a replyQueue in the configuration. server.properties file looks like this:

connectionfactory.qpidConnectionfactory=amqp://guest:guest@clientid/test?brokerlist='tcp://10.3.24.99:5672'

Assume "10.3.24.99" is the IP address of the machine where you run the Apache Qpid instance.

After you start WSO2 ESB, there will be Queues created in Apache Qpid for all the Proxy Services you have created in your Synapse configuration, if a message received to any of those queues, ESB will consume those messages and hit the In-Sequence of appropriate Proxy Service.