MQTT的Payload(负载的最大值)是多少?

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chancein007/article/details/77996544

我们在学习使用MQTT协议的时候,有的时候我们需要通过MQTT进行一些二进制的传送,那么请问MQTT进行二进制的传送的时候,最大支持多少个字节?
网上答案五花八门,有说64kb的,有说16kb的,有说256kb,有说256M的,
那么到底是多少呢?
其实答案很简单,就是268435455 bytes(255.99999M,约等于256M),为什么呢?
因为Mosquito的MQTT服务器里面的一个配置文件就是这样说的。

# This option sets the maximum publish payload size that the broker will allow.
# Received messages that exceed this size will not be accepted by the broker.
# The default value is 0, which means that all valid MQTT messages are
# accepted. MQTT imposes a maximum payload size of 268435455 bytes.

猜你喜欢

转载自blog.csdn.net/chancein007/article/details/77996544