0 Replies Latest reply on Apr 14, 2016 2:14 AM by nikunj.patel

    Configure STOMP over websocket in HornetQ provided inside Wildfly 9.

    nikunj.patel

      Hello All,

       

      I need to configure STOMP over websocket inside wildfly 9. What I did so far,

       

      1. After following help on the internet, I added connectors/acceptores in standalone-full.xml for configuring STOMP over websocket. The configuration looks as follow:

      <connectors>

                          <http-connector name="http-connector" socket-binding="http">

                              <param key="http-upgrade-endpoint" value="http-acceptor"/>

                          </http-connector>

                          <http-connector name="http-connector-throughput" socket-binding="http">

                              <param key="http-upgrade-endpoint" value="http-acceptor-throughput"/>

                              <param key="batch-delay" value="50"/>

                          </http-connector>

                          <netty-connector name="netty-connector" socket-binding="netty">

                              <param key="http-upgrade-endpoint" value="netty-acceptor"/>

                          </netty-connector>

                          <netty-connector name="netty-throughput" socket-binding="netty-throughput">

                              <param key="batch-delay" value="50"/>

                          </netty-connector>

                          <in-vm-connector name="in-vm" server-id="0"/>

                      </connectors>

                      <acceptors>

                          <http-acceptor http-listener="default" name="http-acceptor"/>

                          <http-acceptor http-listener="default" name="http-acceptor-throughput">

                              <param key="batch-delay" value="50"/>

                              <param key="direct-deliver" value="false"/>

                          </http-acceptor>

                          <netty-acceptor name="netty-acceptor" socket-binding="netty">

                              <param key="protocols" value="STOMP"/>

                          </netty-acceptor>

                          <netty-acceptor name="netty-throughput" socket-binding="netty-throughput">

                              <param key="batch-delay" value="50"/>

                              <param key="direct-deliver" value="false"/>

                          </netty-acceptor>

                          <in-vm-acceptor name="in-vm" server-id="0"/>

                      </acceptors>

       

      And adde socket-bindings for the same (port 61614).

       

      With this configuration, wildfly 9 starts. But I am not able to connect to STOMP over websocket. Trying to connect using java websocket client over ws://localhost:61614/stomp. But not able to connect using the same. I also tried using the javascript STOMP client library to connect. But result is same and not able to connect using same. (As described here, http://jmesnil.net/stomp-websocket/doc/)

       

      Now after this, I tried adding STOMP_WS protocol on acceptor configuration:

                          <netty-acceptor name="netty-acceptor" socket-binding="netty">

                              <param key="protocols" value="STOMP, STOMP_WS"/>

                          </netty-acceptor>

       

      But when I start Wildfly 9 with this, I results in error saying "Error instantiating remoting acceptor org.hornetq.core.remoting.impl.netty.Netty.NettyAcceptorFactory: HornetQException[errorType=GENERIC_EXCEPTION message=HQ119085: Classpath lacks a protocol-manager for protocol STOMP_WS]"

       

      One other thing is when I start wildflly 9, I see following lines in logs,

       

      10:37:33,866 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 64) HQ221043: Adding protocol support CORE

      10:37:33,878 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 64) HQ221043: Adding protocol support AMQP

      10:37:33,881 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 64) HQ221043: Adding protocol support STOMP


      But I don't see same for STOMP_WS protocol.


      So my question is,

      1. How to configure STOMP_WS in wildfly 9?

      2. If I only configure STOMP with netty connector/acceptor, does that mean it is STOMP over websocket?


      I have tried all this in Wildfly 8,9 and 10 and same things is observed in each versions.


      Any help is very much appreciated!!


      Thanks,

      Nikunj