[英]Spring websocket and Stomp.js - how long should i wait between subscribe and send?
[英]stomp.js with multiple topics subscribe reads
和 MQTT 一样,我可以通过 Stomp 使用“#”字符订阅所有主题吗?
var onConnect = function(frame) {
debug("connected to MQTT");
$('#connect').fadeOut({ duration: 'fast' });
$('#connected').fadeIn();
client.subscribe('#');
};
/* ------------------------------ */
client.connect(login, passcode, function(frame) {
client.debug("connected to Stomp");
client.subscribe('#', function(message) {});
});
没有 STOMP 作为协议没有内置到规范中的那种寻址定义,所以它从不支持那种全局订阅。 当涉及到通配符时,STOMP 中的地址模型主要与 ActiveMQ JMS 客户端的地址模型相同,您可以在此处阅读。
您可以使用示例:
为了跺脚
XXX.YYY.ZZZ => XXX.YYY.>
(it will be get all topics with contains XXX.YYY topics )
对于 mqtt
XXX/YYY/ZZZ => XXX/YYY/#
(it will be get all topics with contains XXX.YYY topics )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.