StompleJavaScript消息传输框架
Stomple 是一个基于 WebSocket 实现了 Stomp 消息传输框架协议的 JavaScript 包。
示例代码:
var client = Stomple.create_client({
url : "ws://localhost:61614/stomp",
destination : "jms.topic.chat",
login : "guest",
passcode : "guest"
});
client.subscribe({
success: function(frame) {//called if subscribe succeeds within timeout-period
//subscribe succeeded... do something
},
failure: function(spec) {//called if subscribe fails or times out
console.log(spec.reason);
},
handler: function(msg) {//called when a message arrived ('this' is scope - see below)
this.received = msg.body;//"this" is "someObject"
},
scope: someObject
});
主要特点:
1. 可定制以及回调功能
2. 自动收取消息(client.autoReceipt)
3.支持超时处理
4. 事务管理
5. 正确性
评论
stomp消息传输框架
Stomp提供了客户端和代理之间进行广泛消息传输的框架。Stomp是一个非常简单而且易用的通讯协议实现,尽管代理端的编写可能非常复杂,但是编写一个Stomp客户端却是很简单的事情,另外你可以使用Tel
stomp消息传输框架
0
MQTT消息传输协议
MQ遥测传输(MQTT)是轻量级基于代理的发布/订阅的消息传输协议,设计思想是开放、简单、轻量、易于实现。这些特点使它适用于受限环境。例如,但不仅限于此:网络代价昂贵,带宽低、不可靠。在嵌入设备中运行
MQTT消息传输协议
0