thin-edge/thin-edge.io

Built in mqtt bridge restricted to 10240 bytes

Closed this issue · 2 comments

Describe the bug

ERROR tedge_mqtt_bridge::health: MQTT bridge failed to connect to local broker: Mqtt state: Mqtt serialization/deserialization error: payload size limit exceeded: 12928

The bug happens when using the built in mqtt bridge with c8y. Instead of the possible 16 KiB (refer to https://cumulocity.com/docs/device-integration/mqtt/), it seems to be restricted to 10240 bytes.
Following explanation copy pasted from Rina with some details:
"The error is coming the external MQTT library that we use rumqttc. By default, the library sets 10240 bytes as its max_packet_size. https://docs.rs/rumqttc/latest/src/rumqttc/lib.rs.html#493-514
This max_packet_size is configurable API and it seems we just don't change it from the default value."

To Reproduce
Use the built in mqtt bridge with c8y and send a message with payload size > 10240 bytes.

Expected behavior
Message can be sent

Environment (please complete the following information):

  • OS [incl. version]: All
  • Hardware [incl. revision]: All
  • System-Architecture [e.g. result of "uname -a"] : All
  • thin-edge.io version [e.g. 0.1.0] : 1.2.0

The PR that fixed this was: jarhodes314@359384e

The limit is now set to ~256MiB which the maximum payload allowed by MQTT.

The bug is not reproducable anymore