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("失败")
},'/');