在 Wildfly 9 中通过 websocket 配置 STOMP

Configure STOMP over websocket in Wildfly 9

我需要在 wildfly 9 中通过 websocket 配置 STOMP。到目前为止我做了什么,

  1. 根据网上的帮助,我在 standalone-full.xml 中添加了 connectors/acceptores 以通过 websocket 配置 STOMP。配置如下所示:

并为其添加套接字绑定(端口 61614)。

使用此配置,wildfly 9 启动。但是我无法通过 websocket 连接到 STOMP。尝试通过 ws://localhost:61614/stomp 使用 java websocket 客户端进行连接。但无法使用相同的方式连接。我还尝试使用 javascript STOMP 客户端库进行连接。但结果相同,无法使用相同的方式连接。 (如此处所述,http://jmesnil.net/stomp-websocket/doc/

在此之后,我尝试在接受器配置上添加 STOMP_WS 协议:

但是当我用这个启动 Wildfly 9 时,我会报错说 "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]"

另一件事是当我启动 wildflly 9 时,我在日志中看到以下几行,

10:37:33,866 INFO [org.hornetq.core.server](ServerService 线程池 -- 64)HQ221043:添加协议支持 CORE 10:37:33,878 INFO [org.hornetq.core.server](ServerService 线程池 -- 64)HQ221043:添加协议支持 AMQP 10:37:33,881 INFO [org.hornetq.core.server](ServerService 线程池 -- 64)HQ221043:添加协议支持 STOMP

但我认为 STOMP_WS 协议不一样。

所以我的问题是, 1、wildfly 9如何配置STOMP_WS? 2.如果我只用netty配置STOMP connector/acceptor,是否意味着它是STOMP over websocket?

我已经在 Wildfly 8、9 和 10 中尝试了所有这些,并且在每个版本中都观察到相同的情况。

非常感谢任何帮助!!

在 Wildfly 9 中更改 Netty jar 后,此问题已解决。之前是 netty-all-4.0。26.Final.jar。我用netty-all-4.0.13.Final.jar替换了它。现在我可以使用以下配置通过 websocket 连接到 STOMP:

                <netty-acceptor name="netty-acceptor" socket-binding="netty">
                    <param key="protocols" value="STOMP"/>
                </netty-acceptor>

注意:我没有使用 STOMP_WS 协议。