Friday, June 21, 2013

JMS message store with weblogic ESB 4.6.0


To setup the JMS message store with weblogic, please follow the steps as mentioned below.

1. Set the transport receiver configuration as below in ESB_HOME/repository/conf/axis2/axis2.xml

   <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
       <parameter name="myQueueConnectionFactory" locked="false">
               <parameter name="java.naming.factory.initial" locked="false">weblogic.jndi.WLInitialContextFactory</parameter>
               <parameter name="java.naming.provider.url" locked="false">t3://localhost:7001</parameter>
               <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">jms/myconnectionFactory</parameter>
               <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
               <parameter name="transport.jms.UserName" locked="false">weblogic</parameter>
               <parameter name="transport.jms.Password" locked="false">admin123</parameter>
       </parameter>
       <parameter name="default" locked="false">
               <parameter name="java.naming.factory.initial" locked="false">weblogic.jndi.WLInitialContextFactory</parameter>
               <parameter name="java.naming.provider.url" locked="false">t3://localhost:7001</parameter>
               <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">jms/myconnectionFactory</parameter>
               <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
               <parameter name="transport.jms.UserName" locked="false">weblogic</parameter>
               <parameter name="transport.jms.Password" locked="false">admin123</parameter>
       </parameter>
   </transportReceiver>

2. Create a queue connection factory named ‘myconnectionFactory’ with JNDI name ‘jms/myconnectionFactory’
3. Create queue named ‘wso2MessageQueue’ with JNDI name ‘jms/wso2MessageQueue’
4. Remove the following packages from the ‘wlfullclient.jar’ weblogic java clien.
  • javax.jms
  • javax.xml.namespace

5. Copy the wlfullclient.jar to repository/components/lib of the ESB
6. You need to apply a patch to the org.wso2.carbon.message.store jar. Copy the patched org.wso2.carbon.message.store_4.0.5.jar to repository/components/plugins
7. Start the server (Weblogic server should be running)
8. Create a message store using the ESB. The message-store parameters should be as follows.

<messageStore name="wso2MessageStore" class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore" xmlns="http://ws.apache.org/ns/synapse">
  <parameter name="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</parameter>
  <parameter name="java.naming.provider.url">t3://localhost:7001</parameter>
  <parameter name="store.jms.destination">jms/wso2MessageQueue</parameter>
  <parameter name="store.jms.connection.factory">jms/myconnectionFactory</parameter>
  <parameter name="store.jms.username">weblogic</parameter>
  <parameter name="store.jms.password">admin123</parameter>
  <parameter name="store.jms.JMSSpecVersion">1.1</parameter>
  <parameter name="store.jms.cache.connection">false</parameter>
  <parameter name="store.jms.ConsumerReceiveTimeOut">300</parameter>
  <parameter name="vender.class.loader.enabled">false</parameter>
</messageStore>

9. Save the message store. This would query the JMS queue in weblogic for the queue size and the resulting list view would show the number of messages in the queue.
10. You can send messages to a queue using a proxy configuration similar to the following.

<proxy xmlns="http://ws.apache.org/ns/synapse" name="weblogicJmsStore" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
  <target>
     <inSequence>
        <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
        <property name="target.endpoint" value="SimpleStockQuoteService"/>
        <log level="full"/>
        <store messageStore="wso2MessageStore"/>
     </inSequence>
  </target>
  <description></description>
</proxy>

11. Send a message using the try this service for the proxy.
12. View the sent message via the message store UI of the ESB.

https://www.dropbox.com/s/cmwhewpm6asw5j6/org.wso2.carbon.message.store-4.0.5.jar

No comments:

Post a Comment