以rabbitmq的stomp协议为例
1 进入rabbmitmq的docker容器,开启stomp
root@d8f9ff5ca26c:/# rabbitmq-plugins enable rabbitmq_web_stomp
Enabling plugins on node rabbit@d8f9ff5ca26c:
rabbitmq_web_stomp
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_stomp
rabbitmq_web_dispatch
rabbitmq_web_stomp
Applying plugin configuration to rabbit@d8f9ff5ca26c...
Plugin configuration unchanged.
2添加设置路由和服务
路由设置
3 请求
// Stomp.js boilerplate
const queueName = 'User_1'; // 定义队列名称
var client = Stomp.client('ws://' + '