Vue使用rabbitMQ

2019-04-02  本文已影响0人  半灬边灬天

1.下载

npm install stompjs

2.导入文件

var Stomp = require('stompjs');

3.监听端口

var ws =new WebSocket('ws://25.30.9.141:15674/ws');

var client =Stomp.over(ws);

client.connect('guest','guest',function () {

var subscription =client.subscribe("/exchange/BaseDataExchange/routeData.alarm.65.#",function (message) {

alert(message)

},{

'x-queue-name':'hahah',

'durable':true

  });

},function () {

alert("失败")

},'/');

上一篇 下一篇

猜你喜欢

热点阅读