Mqtt精髓系列之预备知识
2017-11-29 10:44
465 查看
翻译:https://www.hivemq.com/blog/mqtt-essentials-part2-publish-subscribe
时间解耦:消息发布方和订阅方不需要同时在线发布和接受消息;
空间解耦:消息发布方和订阅方只需要感知Broker的地址即可;
基于消息内容过滤;
基于消息类型过滤;
广播消费:一条会投递给集群中的所有机器(mqtt使用);
协议开销: Mqtt协议非常轻量级,从而消息头非常小,且方便不同语言的客户端快速开发;
The client implementation of the MQTT protocol is very straight-forward and really reduced to the essence. That’s one aspect, why MQTT is ideally suitable for small devices. MQTT client libraries are available for a huge variety of programming languages, for example Android, Arduino, C, C++, C#, Go, iOS, Java, JavaScript, .NET.
Topic发布和订阅: Mqtt的Topic发布和订阅都是动态的,不需要提前发布和订阅;
In comparison to a message queue a topic is very lightweight. There is no need for a client to create the desired topic before publishing or subscribing to it, because a broker accepts each valid topic without any prior initialization.
发布/订阅模式优势
传统请求/应答模式是同步的,发布/订阅模式是异步的,这种模式带来以下几种好处:时间解耦:消息发布方和订阅方不需要同时在线发布和接受消息;
空间解耦:消息发布方和订阅方只需要感知Broker的地址即可;
消息过滤方式
基于Topic过滤(mqtt使用);基于消息内容过滤;
基于消息类型过滤;
消息消费方式
集群消费:一条只会投递给集群中某一台机器;广播消费:一条会投递给集群中的所有机器(mqtt使用);
与MQ等消息队列区别
应用场景: Mqtt针对物联网场景做了很多优化,如遗嘱消息、持久会话等;协议开销: Mqtt协议非常轻量级,从而消息头非常小,且方便不同语言的客户端快速开发;
The client implementation of the MQTT protocol is very straight-forward and really reduced to the essence. That’s one aspect, why MQTT is ideally suitable for small devices. MQTT client libraries are available for a huge variety of programming languages, for example Android, Arduino, C, C++, C#, Go, iOS, Java, JavaScript, .NET.
Topic发布和订阅: Mqtt的Topic发布和订阅都是动态的,不需要提前发布和订阅;
In comparison to a message queue a topic is very lightweight. There is no need for a client to create the desired topic before publishing or subscribing to it, because a broker accepts each valid topic without any prior initialization.
相关文章推荐
- Windows 7的预备知识系列之一:Windows 7启动与停止
- Windows 7的预备知识系列之二:认识Windows 7中的窗口
- 【PSI/SI学习系列】2.PSI/SI深入学习1——预备知识
- Web Client Software Factory系列(1):初识与预备知识
- [导入]Web Client Software Factory系列(1):初识与预备知识
- JavaScript系列讲座(1):预备知识
- Web Client Software Factory系列(1):初识与预备知识 推荐
- onvif开发系列之--------关于gsoap的预备知识
- Mqtt精髓系列之保留消息Retained Messages
- Mqtt精髓系列之服务质量Qos
- C++ Primer知识系列一:预备知识、数据及基本类型
- Mqtt精髓系列之发布订阅
- 【原创】ASP.NET Web 应用开发实战快速上手系列 1——配置环境及预备知识(框架、VS、C#)
- Windows 7的预备知识系列之二:认识Windows 7中的窗口
- Mqtt精髓系列之精简之道
- Oracle系列:(3)Oracle预备知识
- 【PSI/SI学习系列】2.PSI/SI深入学习1——预备知识
- Oracle系列:(4)Oracle预备知识2
- Windows 7的预备知识系列之一:Windows 7启动与停止
- 【PSI/SI学习系列】2.PSI/SI深入学习1——预备知识