11 Replies Latest reply on Sep 30, 2012 10:47 PM by roboticon

    openWire http tunneling

    roboticon

      This details an issue/question with http tunneling of tcp connections using Fuse MQ Enterprise 7.0.1:

       

      According to the Fuse ESB Enterprise doc:

      +"Connect to the message broker endpoint at Host:Port using the OpenWire over HTTP protocol (HTTP tunneling). You can use this protocol to navigate through firewalls.

       

      This URL is also used to configure the transport connector in a broker."+

       

      Reproducing the issue

       

      - install fuse-mq-7.0.1.fuse.084 for linux 64bit

      - using open-jdk 1.6

      - edit the etc/activemq.xml file to use an http transportConnector (replace tcp with http)

      - execute bin/fusemq

       

      The following error is seen on the Fuse MQ console:

       

      +Caused by: java.io.IOException: Service not found: 'META-INF/services/org/apache/activemq/transport/http' +

       

      Do I need to add commons-httpclient jars and xstream jars to the lib/ext folder?

      Will the etc/config.properties need to show the packages for OSGi use?

      Is the services.org.apache.activemq.transport.http available elsewhere?

       

      Thanks,

      --scott

        • 1. Re: openWire http tunneling
          roboticon

          FuseMQ:karaf@fusemq> features:install activemq-optional

           

          silenced the exceptions on the console, however the mq-client.jar seems to also need the classes

           

          java -jar lib/mq-client.jar producer --count 10 --size 80 --brokerUrl http://localhost:61616Using destination: queue://TEST, on broker: http://localhost:61616

           

          -


           

          : Could not start a connection

          javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized:

           

               ... 6 more

          Caused by: java.io.IOException: Could not find factory class for resource: META-INF/services/org/apache/activemq/transport/http

               at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.loadProperties(FactoryFinder.java:96)

               at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.create(FactoryFinder.java:58)

               at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:146)

               at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:201)

               ... 8 more

          Execution failed with: javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized:

          javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized:

               at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)

               at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:250)

               at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:263)

               at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:235)

               at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:183)

               at org.fusesource.mq.ActiveMQService.start(ActiveMQService.java:89)

               at org.fusesource.mq.Main.execute(Main.java:96)

               at org.fusesource.mq.Main.main(Main.java:82)

           

           

           

          --scott

          • 2. Re: openWire http tunneling
            davsclaus

            Have you restarted the FuseMQ server after you installed the activemq-option feature?

            • 3. Re: openWire http tunneling
              roboticon

              restarting Fuse MQ Enterprise does not help my mq-client.jar issue.

               

              FMQ does show the activemq-optional features is available.

               

              If I change etc/activemq.xml from "http" to "tcp", and restart it works. 

               

              Thanks for helping.

              --scott

              • 4. Re: openWire http tunneling
                roboticon

                The ./lib/mq-client.jar looks like an osgi bundle, which does not include the activemq-optional component. 

                 

                --scott

                • 5. Re: openWire http tunneling
                  davsclaus

                  Yes I dont think mq-client JAR has all the various different transports. Its TCP based by default. If you want to use http / mqtt etc you would need to add the extra JARs you need to the classpath.

                  • 6. Re: openWire http tunneling
                    roboticon

                    mq-client.jar is created using the maven-bundle-plugin, so the classpath is baked into the jar.

                     

                    Manifest-Version: 1.0

                    Export-Package: org.fusesource.mq;uses:="org.apache.commons.logging,or

                    g.apache.activemq.command,javax.jms,org.apache.activemq,org.slf4j";ve

                    rsion="7.0.1.fuse-084"

                    Implementation-Title: FuseSource FON

                    Built-By: roboticon

                    Tool: Bnd-1.15.0

                    Implementation-Vendor: FuseSource

                    Implementation-Vendor-Id: org.fusesource.mq

                    Specification-Title: mq-client

                    Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt

                    Bundle-SymbolicName: org.fusesource.mq.mq-client

                    Implementation-Version: 7.0.1.fuse-084

                    Specification-Vendor: FuseSource

                    Class-Path: ../system/org/apache/activemq/activemq-core/5.5.1.fuse-70-

                    084/activemq-core-5.5.1.fuse-70-084.jar ../system/org/slf4j/slf4j-api

                    /1.6.1/slf4j-api-1.6.1.jar ../system/org/apache/geronimo/specs/geroni

                    mo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar ../system/org/a

                    pache/geronimo/specs/geronimo-j2ee-management_1.1_spec/1.0.1/geronimo

                    -j2ee-management_1.1_spec-1.0.1.jar ../system/org/apache/activemq/act

                    ivemq-optional/5.5.1.fuse-70-084/activemq-optional-5.5.1.fuse-70-084.

                    jar ../system/org/apache/activemq/activeio-core/3.1.2/activeio-core-3

                    .1.2.jar ../system/commons-logging/commons-logging/1.1/commons-loggin

                    . . .

                     

                    --scott

                    • 7. Re: openWire http tunneling
                      roboticon

                      This change got it working:

                       

                      1. starting with mq-client 7.0.1-70-084

                      http://repo.fusesource.com/nexus/content/repositories/releases/org/fusesource/mq/mq-client/7.0.1.fuse-084/

                       

                      2. updated pom.xml to include activemq-optional

                       

                             

                       

                      3.  rebuilt the mq-client jar using maven

                       

                      4.  deployed the mq-client.jar to fuse-mq enterprise lib folder

                       

                      5.  added the dependencies (JARs) to fuse-mq enterprise system folder

                      - org/apache/activemq/activemq-optional/5.5.1.fuse-70-084/activemq-optional-5.5.1.fuse-70-084.jar

                      - org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2.jar

                      - org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.jar

                      - com/thoughtworks/xstream/xstream/1.4.2/xstream-1.5.2.jar

                      - xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar

                      - xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar

                      - xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar

                       

                      6. from fuse-mq-esb root folder..

                      java -jar ./lib/mq-client.jar producer --count 10 --brokerUrl http://localhost:61616

                       

                      Note the xmpp feature will require additional JARs to function.

                       

                      --scott

                       

                      Edited by: roboticon on Sep 28, 2012 6:08 AM

                      • 8. Re: openWire http tunneling
                        davsclaus

                        Well you ought to be able to add additional jars to the jvm using the -cp option. But in the end you got it working.

                        • 9. Re: openWire http tunneling
                          roboticon

                          I tried doing that, initially.  But, this was before I fully understood all of the dependencies.

                          • 10. Re: openWire http tunneling
                            roboticon

                            This is the -cp option:

                             

                            java -cp ./system/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.jar:./system/org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2.jar:./system/com/thoughtworks/xstream/xstream/1.4.2/xstream-1.4.2.jar:./system/org/apache/activemq/activemq-optional/5.5.1.fuse-70-084/activemq-optional-5.5.1.fuse-70-084.jar:./system/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar:./system/xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar:./system/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar   -jar lib/mq-client.jar   producer --count 10 --brokerUrl http://localhost:61616

                             

                            It does not work.

                             

                            I think it's probably related to the use of the OSGi maven plugin, to build the mq-client.jar

                             

                            --scott

                            • 11. Re: openWire http tunneling
                              roboticon

                              Correction...

                               

                              Replacing jar ./lib/mq-client.jar with org.fusesource.mq.Main worked...

                               

                               

                              java -cp ./system/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.jar:./system/org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2.jar:./system/com/thoughtworks/xstream/xstream/1.4.2/xstream-1.4.2.jar:./system/org/apache/activemq/activemq-optional/5.5.1.fuse-70-084/activemq-optional-5.5.1.fuse-70-084.jar:./system/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar:./system/xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar:./system/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:./lib/mq-client.jar org.fusesource.mq.Main   producer --count 10 --brokerUrl http://localhost:61616

                               

                              --scott