MQTT:QoS服务质量 0,1,2(Quality of Service 0, 1 2)
原文链接:http://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
转载链接:http://blog.sina.com.cn/s/blog_a5e78d1d0102wqkr.html(对转载文章的翻译进行小修改)
- 最多一次(0)
- 最少一次(1)
- 只一次(2)
发送者将会存储发送的信息直到发送者收到一次来自接收者的PUBACK格式的应答。
PUBLISH 与PUBACK的关联是通过比较数据包中的packet identifier完成的。如果在特定的时间内(timeout)发送端没有收到PUBACK应答,那么发送者会重新发送PUBLISH消息。如果接受者接收到QoS为1 的消息,它会立即处理这里消息,比如把这个包发送给订阅该主题的接收端,并回复PUBACK包。
QoS 2
Packet identifiers 是每个消息流唯一的
以下的建议会给你一些指导。通常这很大程度上取决于您的用例。
Best Practice
We are often asked, when to choose which QoS level. The following should provide you some guidance if you are also confronted with this decision. Often this is heavily depending on your use case.
Use QoS 0 when …
- You have a complete or almost stable connection between sender and receiver. A classic use case is when connecting a test client or a front end application to a MQTT broker over a wired connection.
- You don’t care if one or more messages are lost once a while. That is sometimes the case if the data is not that important or will be send at short intervals, where it is okay that messages might get lost.
- You don’t need any message queuing. Messages are only queued for disconnected clients if they have QoS 1 or 2 and a persistent session.
Use QoS 1 when …
- You need to get every message and your use case can handle duplicates. The most often used QoS is level 1, because it guarantees the message arrives at least once. Of course your application must be tolerating duplicates and process them accordingly.
- You can’t bear the overhead of QoS 2. Of course QoS 1 is a lot fast in delivering messages without the guarantee of level 2.
Use QoS 2 when …
- It is critical to your application to receive all messages exactly once. This is often the case if a duplicate delivery would do harm to application users or subscribing clients. You should be aware of the overhead and that it takes a bit longer to complete the QoS 2 flow.
Queuing of QoS 1 and 2 messages
All messages sent with QoS 1 and 2 will also be queued for offline clients, until they are available again. But queuing is only happening, if the client has a persistent session.
MQTT:QoS服务质量 0,1,2(Quality of Service 0, 1 2)相关推荐
- MQTT QoS服务质量
MQTT(Quality of Service)设计了三个等级: QoS 0:消息最多传递一次,如果当时客户端不可用,则会丢失该消息. QoS 1:消息传递至少 1 次. QoS 2:保证消息到达对方 ...
- QOS是什么?(Quality of Service,服务质量)
看 单播.广播.组播的区别和特点 时候,看到QOS不知道是什么意思 文章目录 定义 QoS(Quality of Service,服务质量)指一个网络能够利用各种基础技术,为指定的网络通信提供更好的服 ...
- Quality of Service 0, 1 2
来自:http://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels Quality of Servi ...
- QoS(Quality of Service)服务质量【转自微信公众号开源Linux】
QoS(Quality of Service)即服务质量.在有限的带宽资源下,QoS为各种业务分配带宽,为业务提供端到端的服务质量保证.例如,语音.视频和重要的数据应用在网络设备中可以通过配置QoS优 ...
- 服务质量QoS(Quality of Service)的基础知识
QoS概述 浅谈QoS--QoS概述 网络抓包工具Wireshark下载安装&使用详细教程 QoS简介 在传统的计算机网络中,网络设备对于数据包的处理方式都是相同的,平等的对待所有的数据流量. ...
- MQTT QoS 设计:车联网平台消息传输质量保障
在本专题系列文章中,我们将根据 EMQ 在车联网领域的实践经验,从协议选择等理论知识,到平台架构设计等实战操作,与大家分享如何搭建一个可靠.高效.符合行业场景需求的车联网平台. 在此之前,我们已经介绍 ...
- MQTT QoS 详解
本文主要介绍 MQTT 协议中 QoS(服务质量) 的详细内容. 1.概述 MQTT 协议 中规定了消息服务质量(Quality of Service),它保证了在不同的网络环境下消息传递的可靠性,Q ...
- php mqtt qos,Mqtt Qos 深度解读
1.QoS含义 : Quality of Service,服务质量 2.作用域 发布者的Qos 订阅者的Qos 3.等级与作用 level 0:最多一次的传输 level 1:至少一次的传输,(鸡肋) ...
- QoS服务质量五QoS边界行为之流量整形
QoS服务质量五QoS边界行为之流量整形 3.流量整形 3.1.GTS的原理 3.2.自适应流量整形 3.3流量监管和流量整形应用场景 3.4.配置限速(流量监管和流量整形) 3.4.1.配置流量整形 ...
最新文章
- 【Unity】5.1 3D坐标系基础知识
- linux信号处理编程实验报告,Linux编程之信号处理
- Python格式化字符串、占位符、合并数组
- boost::mp11::mp_reverse相关用法的测试程序
- java解压gz文件
- 使用腾讯开发平台获取QQ用户数据资料
- c语言字符串倒置,单词倒置,用C++实现,将一句话里的单词进行倒置的方法详解
- android 开发 切图,Android开发,切图网站推荐。
- 利用Snapshot快速跨Region迁移服务器
- synchronized的作用以及不足
- 最新二开版漫画小说听书三合一完整源码/整合免签接口/搭建教程/带采集接口
- 软件体系结构第三章作业
- java要学多久_学会JAVA需要多长时间?
- 显示器接口_显示器接口 - CNZHIQIANG
- 嵌入式单片机STM32原理及应用
- SCI论文配色-matplotlib分类柱状图绘制
- 《肖申克的救赎》观后感
- 造成主板通电自动开机的原因 【转】
- 《从一到无穷大:科学中的事实和臆测》小记
- 修改seting里面的休眠时间列表