3 Replies Latest reply on Jul 22, 2010 10:48 AM by robert.geisler

    jboss-6.0.0-M3: JMS over HTTP (servlet)

    robert.geisler Newbie

      hello everybody...

      currently i am testing JBoss 6.0.0 M3 and got stuck with the JMS Provider, HornetQ, as it came to HTTP/ HTTPS. i read the documentation (user manual) and followed chapter 16, 'configuring the transport', but in the end it does not work as expected.


      my situation: i am running an EJB application in JBoss, which services will get used by a standalone Java client through JNDI. also the client(s) register to a JMS topic; my application sends JMS Messages to this topic to send information to the client(s). JMS works in default configuration: topic gets deployed, client uses JNDI name 'ConnectionFactory' to lookup JMS Connection Factory, is able to connect to my topic and to recieve JMS messages.


      But i want to configure HornetQ for servlet transport to tunnel traffic over http to a servlet.
      what i did to achieve this is as follows...


      1) deploy/configure HornetQ Servlet in /deploy/hornetq-servlet.war/WEB-INF/web.xml:


      {code:xml}<?xml version="1.0" encoding="UTF-8"?>
      <web-app ... >



      2) deploy/ configure HornetQ acceptor in /deploy/hornetq/hornetq-configuration.xml:


      {code:xml}<configuration ... >

            <acceptor name="netty-servlet-acceptor">
              <param key="host" value="org.hornetq"/>
              <param key="use-invm" value="true"/>


      3) deploy/ configure HornetQ connector in /deploy/hornetq/hornetq-configuration.xml:


      {code:xml}<configuration ... >

            <connector name="netty-servlet-connector">
              <param key="host" value=""/>
              <param key="port" value="28080"/>
              <param key="servlet-path" value="/hornetq-servlet/HornetQServlet"/>
              <param key="use-servlet" value="true"/>


      4) deploy/ configure JMS Connection Factory in /deploy/hornetq/hornetq-jms.xml:


      {code:xml}<configuration ... >

         <connection-factory name="NettyServletConnectionFactory">
               <connector-ref connector-name="netty-servlet-connector"/>
               <entry name="/HTTPConnectionFactory"/>


      you see, i tried to stick with the documentation. but with all these configurations... the result is:

      1) client looks up JMS Connection Factory through JNDI (name = "HTTPConnectionFactory"),
      2) client creates JMS Connection by factory,
      3) client starts JMS Connection,
      4) client tries to stop JMS Connection.


      ConnectionFactory factory = (ConnectionFactory) context.lookup("HTTPConnectionFactory");
      Connection connection = factory.createConnection();



      when client stops the JMS Connection, HornetQ prints out a warning 'Timed out waiting for channel to close'.
      however, it seems the connection will actually never been closed, because the thread does not finish; have a look at system.out:


      07.07.2010 10:09:41 org.hornetq.core.logging.impl.JULLogDelegate warn
      WARNUNG: Timed out waiting for channel to close{quote}


      said all that my question are:
      1) why is the connection never closed?
      2) am i missing any configuration?

      3) i am confused about the 'endpoint' param of HttpTunnelingServlet and 'host'  param of HornetQ acceptor. what are the correct values to set??



      looking forward to your answers.
      thanks in advance.



      HornetQ 2.1.0.BETA3
      jboss bind adress:
      tomcat http port: 28080