js接收activeMq消息
var url = "ws://ip:61614";
var userName = "admin";
var pwd = "admin";
引用 stomp.js
//连接
if(window.WebSocket) {
var destination = "/topic/jcz_board2_yujing"; //topic名称
client = stomp.client(url);
// this allows to display debug logs directly on the web page
client.debug = function(str) {
console.log(str)
};
client.connect(userName, pwd, function(frame) {
client.debug("connected to Stomp");
client.subscribe(destination, function(message) {
console.log(message)
});
});
}
//断开
mqClient.disconnect(function() {});
js接收activeMq消息
,温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/43033.html
- 上一篇:selenium实现网页截全屏
- 下一篇:推荐 11 个好用的 JS 动画库