Tuesday, July 19, 2011

Configuring WSO2ESB 4.0.0 with QPid

This is how we need to  configure ESB with Qpid,

1) Edit axis2.xml file(ESB_HOME/rpository/conf/axis2.xml) like;

Under transport In section;
<!--Transport Ins -->
<!--Uncomment this and configure as appropriate for JMS transport support with Apache Qpid -->

<transportReceiver name="jms" class="org.apache.axis2.transport.jms.
JMSListener">

 <parameter name="myTopicConnectionFactory" locked="false">
   <parameter name="java.naming.factory.initial" locked="false">
    org.apache.qpid.jndi.PropertiesFileInitialContextFactory</parameter> 
    repository/conf/jndi.properties</parameter>
   <parameter name="java.naming.provider.url" locked="false">
     repository/conf/jndi.properties</parameter>  
   <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">
    TopicConnectionFactory</parameter>
   <parameter name="transport.jms.ConnectionFactoryType" locked="false">
    topic</parameter>
 </parameter>
 <parameter name="myQueueConnectionFactory" locked="false">
    <parameter name="java.naming.factory.initial" locked="false">
    org.apache.qpid.jndi.PropertiesFileInitialContextFactory</parameter>
    <parameter name="java.naming.provider.url" locked="false">
    repository/conf/jndi.properties</parameter>
    <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">
    QueueConnectionFactory</parameter>
    <parameter name="transport.jms.ConnectionFactoryType" locked="false">
    queue</parameter>
  </parameter>

</transportReceiver>

Under Transport Outs section;


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

2) At jndi.properties file(ESB_HOME/repository/conf/jndi.properties);
Add following lines to create connectionfactory, queue , topic etc..

connectionfactory.TopicConnectionFactory = amqp://admin:admin@carbon/carbon?brokerlist='tcp://localhost:5672'
connectionfactory.QueueConnectionFactory = amqp://admin:admin@carbon/carbon?brokerlist='tcp://localhost:5672'
queue.MyQueue = example.MyQueue
queue.DLCStore = example.DLCStore


3) Your MessageStore configuartaion should have minimum three parameters;

<messageStore xmlns="http://ws.apache.org/ns/synapse" class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore" name="testMsgStore">
    <parameter name="java.naming.factory.initial">org.apache.qpid.jndi.PropertiesFileInitialContextFactory</parameter>
    <parameter name="java.naming.provider.url">repository/conf/jndi.properties</parameter>
    <parameter name="store.jms.destination">MyQueue</parameter>
</messageStore>



I have written a KB about configuring Qpid with WSO2 ESB,which has been published @ WSO2 OT..

No comments:

Post a Comment