不使用SockJS的RabbitMQ Web STOMP

5

是否可以在没有SockJS库的情况下设置RabbitMQ Web STOMP连接?

我尝试使用rabbitmq-web-stomp插件,但未能成功,因为服务器生成的初始响应是Welcome to SockJS!(这显然不是基于STOMP的消息)。

真的需要使用SockJS吗?除了支持旧版浏览器之外,它还有什么作用?

1个回答

6

SockJS协议支持/websocket路径下使用原始WebSocket客户端。

Any SockJS server complying with 0.3 protocol does support a raw WebSocket url. The raw WebSocket url for the test server looks like:

ws://localhost:8081/echo/websocket

You can connect any WebSocket RFC 6455 compliant WebSocket client to this url.

这也被Rabbit实现所支持。因此,默认端点为:http://example.com:15674/stomp/websocket


4
RabbitMq web stomp不支持WebSocket的PING帧消息,服务器不会回送PONG帧。这就是为什么client.heartbeat.outgoing和client.heartbeat.incoming被设置为0的原因(详见官方示例 - "SockJS does not support heart-beat: disable heart-beats")。因此,如果您不将client.heartbeat.*设置为0,则您的连接将被代理或stomp-websocket库终止。 - develar

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接