3 Replies Latest reply on Sep 9, 2011 3:41 PM by Marcelo Jabali

    Problem with openwire example - http endpoint not listening

    David Caldwell Newbie



      I'm following the steps in the jms broker connectivity guide for the openwire example - http://fusesource.com/docs/esb/4.4/amq_connectivity/index.html.  Producing and consuming via the tcp endpoints work fine.  However when I get to the step "run the producer with the http protocol", the producer fails to connect to the broker.


      I'm running the ESB from apache-servicemix-4.4.0-fuse-00-43.  I'm running the example from apache-activemq-5.5.0-fuse-00-27.  And I'm running on windows 7.


      netstat/a shows that nothing is listening on the http port configured in broker1-broker.xml.


      I increased the esb log level to debug and looked at the logs after saving the changes to the broker xml file to add the http transport.  There is a zipexception, but it's by the WarDeployer, and it's followed up by a "lixDispatchQueue, xml, broker1-broker.xml, BundleEvent INSTALLED" log, so I expect the war deployer exception to be unimportant.


      The only other thing I can think of in my configuration that might be important is that during the ESB installation, in the install guide, chapter 2, there is an optional step of removing the jbi container.


      I removed jbi-* & servicemix-* from featuresBoot in etc/org.apache.karaf.features.cfg.  I also added the woodstox feature as a workaround to a problem I encountered running the ESB /cxf/HelloWorld example.


      Any ideas on what I need to do to get the http transport working?



        • 1. Re: Problem with openwire example - http endpoint not listening
          Marcelo Jabali Newbie

          Hi David,


          I just ran a quick test using FUSE MB 5.5.0 and followed the instructions available in the Openwire example ( http://fusesource.com/docs/esb/4.4/amq_connectivity/index.html?url=http://fusesource.com/docs/esb/4.4/amq_connectivity/N0377FE98.037AC498.html ).


          The only thing I had to change to make it work with the HTTP transport connector was to change the configuration file to include the connector. I used the activemq-demo.xml available under the $FUSEMB_INSTALL_DIR/conf directory and added the following:




          Then, I started the broker pointing to that configuration file:


          bin/activemq console xbean:conf/activemq-demo.xml


          and ran both consumer and producer test sample clients.


          I think that would be a very simple way to test the scenario you want and isolate the components you really need to make it work.


          Hope this helps,



          • 2. Re: Problem with openwire example - http endpoint not listening
            David Caldwell Newbie

            Thanks Marcelo.  Following your steps, I was able to get the example working.  However, if I understand correctly, this is running activemq in a standalone mode rather than in the ESB.


            The way it is documented in the connectivity guide makes me think I should be able to run a broker in the esb that is configured with the http transport.  So far, my attempts to do so have failed.


            Since the default broker is not configured with an http transport, I stopped the activemq-broker.xml bundle, then executed the create-broker step.


            The next problem was that the package org.apache.activemq.hooks was missing, so I did features:install activemq-spring.


            The next problem was that the http transport scheme was not recognized.  There wasn't an uninstalled feature for activemq-optional, so I just copied apache-activemq-5.5.0-fuse-00-27\lib\optional\activemq-optional-5.5.0-fuse-00-27.jar to servicemix deploy directory.


            Now I'm getting a ServletContextHandler class cast exception when the transport connector is being started.  I haven't dug into that one yet, but I'm starting to lose confidence that I'm even going down the right path.


            Am I taking the right steps & just need to go a little further?

            Or is there a simpler way to get http transport working in a broker deployed in the esb?



            • 3. Re: Problem with openwire example - http endpoint not listening
              Marcelo Jabali Newbie

              Thanks for the feedback David. That's correct. The steps I provided you were based in a standalone instance of ActiveMQ where we could isolate that specific component and troubleshoot it.


              You are also correct that FUSE ESB has the capability to run an embedded ActiveMQ instance as it does by default. Basically, the steps should be the same as described in the FUSE ESB documentation (for example,  http://fusesource.com/docs/esb/4.4/amq_connectivity/index.html?url=http://fusesource.com/docs/esb/4.4/amq_connectivity/N0377FE98.037AC498.html ).

              I did a quick test following the steps above and I was able to deploy the broker successfully as long as I wasn't not deploying the HTTP transport connector. I'll have to investigate on that before give you a concrete answer on why it's failing.


              On the other hand, I thought about possible use cases for this and I believe the easiest workaround for you at this point would be using Apache Camel (which is also embedded on ServiceMix) and you could easily create a Camel route that exposes an HTTP endpoint and do whatever you need when other applications connect to it.


              Apache Camel (FUSE Mediation Router) has a component called jetty that provides HTTP-based endpoints for consuming HTTP requests. Simply, you have a Web Server running right there.


              There is a sample here if you want:  http://fusesource.com/docs/router/2.2/component_ref/_IDU_Jetty.html


              That's a slightly different approach to what you're trying to do at the moment but it's also powerful and gives you all features Apache Camel (FUSE Mediation Router) offers  http://fusesource.com/products/enterprise-camel/#documentation .


              Hope this helps,