MQTT代理的最大消息长度是多少? [英] What is the maximum message length for a MQTT broker?

查看:1396
本文介绍了MQTT代理的最大消息长度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将node.js mosca MQTT代理用于某些物联网(iot)应用程序.

I am using the node.js mosca MQTT broker for some internet of things (iot) application.

https://github.com/mcollina/mosca

一个主题可以为mosca代理接收的最大消息长度是多少?限制消息长度的因素有哪些?

What is the maximum message length that a topic can receive for the mosca broker? What are the factors that constrain the message length?

如果要增加消息长度,是否可以修改配置参数,或者可以更改代码的哪一部分?

If I want to increase the message length, is there a configuration parameter I can modify or which part of the code can I change?

推荐答案

您在这里问的不是很清楚,所以我会同时回答这两种可能性.

It's not entirely clear what you're asking here, so I'll answer both possibilities.

实际主题字符串的长度最多为65536个字节.这是mqtt规范施加的限制,您无法更改.还值得注意的是,该主题是使用utf-8编码的,因此可用的字符数可能少于65536.

The length of the actual topic string is at most 65536 bytes. This is a limit imposed by the mqtt spec, you can't change it. It is also worth noting that the topic is encoded with utf-8, so you may have less than 65536 characters available.

消息的有效负载限制为268,435,456字节.同样,这是由规范定义的.

The payload of the message is limited to 268,435,456 bytes. Again, this is defined by the spec.

如果您常规地接近这两个限制中的任何一个,则应考虑您的工作是否明智.

If you are routinely approaching either of these limits you should be thinking about whether what you are doing is sensible.

这篇关于MQTT代理的最大消息长度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆