Friday, July 25, 2014

Without restart: Enabling WSO2 ESB as a JMS Consumer of WSO2 MB

WSO2 ESB 4.8.1 & WSO2 MB 2.2.0 documentations have information on how to configure WSO2 ESB as a JMS Consumer of WSO2 MB queues and topics. But they do not point out a way to do this without restarting ESB server.

In this blog post we'll solve this issue.

With this method we will be able to create new queues in WSO2 MB and consume them from WSO2 ESB without restarting it.

Configure the WSO2 Message Broker

  • Offset the port of WSO2 MB to '1'  
  • Copy andes-client-*.jar and geronimo-jms_1.1_spec-*.jar from $MB_HOME/client-lib to $ESB_HOME/repository/components/lib 
  • Start the WSO2 MB

Configure the WSO2 Enterprise Service Bus

  • Edit the $ESB_HOME/repository/conf/jndi.properties file (comment or delete any existing configuration)
connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
  • Edit the $ESB_HOME/repository/conf/axis2.xml file and uncomment the JMS Sender and JMS Listener configuration for WSO2 Message Broker 
  • Start the WSO2 ESB 

Create Proxy Service

The Proxy Service name will become the queue name in WSO2 MB. If you already have a queue in MB and if you want to listen to that queue, then set that queue name as the proxy service name. Here I'm using 'JMSConsumerProxy' as the queue name and the proxy service name.

<?xml version="1.0" encoding="UTF-8"?> 
<proxy xmlns="http://ws.apache.org/ns/synapse" 
       name="JMSConsumerProxy" 
       transports="jms" 
       statistics="disable" 
       trace="disable" 
       startOnLoad="true"> 
   <target> 
      <inSequence> 
         <property name="Action" 
                   value="urn:placeOrder" 
                   scope="default" 
                   type="STRING"/> 
         <log level="full"/> 
         <send> 
            <endpoint> 
               <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> 
            </endpoint> 
         </send> 
      </inSequence> 
      <outSequence> 
         <drop/> 
      </outSequence> 
   </target> 
   <description/> 
</proxy> 

Testing the scenario

  • Inside $ESB_HOME/samples/axis2Server/src/SimpleStockQuoteService run ant 
  • Now start the Axis2 Server inside $ESB_HOME/samples/axis2Server (run the relevant command line script
  • Log into the WSO2 Message Broker Management Console and navigate to Browse Queues 
  • Find a Queue by the name JMSConsumerProxy 
  • Publish 1 message to the JMSConsumerProxy with payload (this has to be done in the Message Broker Management Console) 
<ser:placeOrder xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd"> 
    <ser:order> 
        <xsd:quantity>4</xsd:quantity> 
    </ser:order> 
</ser:placeOrder>
  • Observe the output on the Axis2 Server and WSO2 ESB console.
Hope this helped you :) 

3 comments:

  1. http://assetsignals.com
    http://assetsignals.net
    http://binaryacademics.com
    http://getbb.com
    http://misterhighdef.com
    http://spotfn.com
    http://spotfn.es
    http://spotfn.in
    http://spotfn.de
    http://777ecigs.com
    http://beste-cigreviews.com
    http://www.mahatmayoga.com
    http://assetsignalsreview.com/

    ReplyDelete
  2. Message Broker Online Training, ONLINE TRAINING – IT SUPPORT – CORPORATE TRAINING http://www.21cssindia.com/courses/massage-broker-online-training-108.html The 21st Century Software Solutions of India offers one of the Largest conglomerations of Software Training, IT Support, Corporate Training institute in India - +919000444287 - +917386622889 - Visakhapatnam,Hyderabad Message Broker Online Training, Message Broker Training, Message Broker, Message Broker Online Training| Message Broker Training| Message Broker| "Courses at 21st Century Software Solutions
    Talend Online Training -Hyperion Online Training - IBM Unica Online Training - Siteminder Online Training - SharePoint Online Training - Informatica Online Training - SalesForce Online Training - Many more… | Call Us +917386622889 - +919000444287 - contact@21cssindia.com
    Visit: http://www.21cssindia.com/courses.html"

    ReplyDelete
  3. Thanks for information,we are providing http://www.keentechnologies.com/sap-crm_technical-online-training.html.For more details visit our website.

    ReplyDelete