Skip to content

Can’t send more than 20kb playload buffer(json) to AWS IoT core Mqtt Broker

0

Hello All, We can't send mqtt playload buffer(json) more than 19kb payload buffer to AWS IoT core Mqtt Broker(default playload buffer set to 128 Kb) https://us-east-2.console.aws.amazon.com/servicequotas/home/services/iotcore/quotas/L-13573643?region=us-east-2# I am using python script to send playload buffer 20kb, but AWS IoT core Mqtt Broker always truncate playload buffer to 19kb only. Our goal is to be able to send On-Demand playload buffer(json) up to 100kb. Current my tests device is periodic send data at AWS IoT core at every 15 minutes periodic.

Test Playload Topic: testBufferSize/json/large Any suggestion? Thanks, Soms

asked a year ago264 views

2 Answers
0

Based on the information provided, there are a few important points to consider regarding your MQTT payload size issue:

AWS IoT Core has a maximum message size limit of 128 KB for MQTT messages. However, there are some nuances to be aware of:

  1. For MQTT-based file delivery, AWS IoT limits the size of a single block to 128 KB. If you request a block larger than this, the request will fail.

  2. If you exceed the message size limit, it will result in a CLIENT_ERROR with reason PAYLOAD_LIMIT_EXCEEDED and a message indicating "Message payload exceeds size limit for message type."

  3. The 100 transactions per second limit mentioned in your question applies per connection to IoT Core, not per topic.

For your specific case where you're trying to send a 20 KB payload but it's being truncated to 19 KB, this could be related to encoding overhead or other factors in your implementation.

Here are some suggestions to address your goal of sending payloads up to 100 KB:

  1. Consider using the AWS IoT MQTT-based file delivery mechanism, which is designed for transferring larger data sets. This allows you to break down your data into smaller blocks and send them sequentially.

  2. For high-volume data transfer, you might want to consider using Stream Manager (if you're using Greengrass) to send messages to Kinesis Data Streams, which is designed for high-volume data transfer to the AWS Cloud.

  3. Verify that your payload isn't exceeding the actual limit when accounting for encoding overhead or metadata.

  4. If you're using Greengrass, be aware that there are spooler mechanisms in place that might affect how your messages are processed.

  5. Check if you're using any compression techniques. If not, consider using CBOR format instead of JSON, which is more compact and might help with your payload size limitations.

Since your device is only sending data every 15 minutes, you should be well within the transaction rate limits, so the issue is likely related specifically to payload size handling.
Sources
Using AWS IoT MQTT-based file delivery in devices - AWS IoT Core
Publish/subscribe AWS IoT Core MQTT messages - AWS IoT Greengrass
MQTT message payload - AWS IoT Core
MQTT - AWS IoT Core
[AWS IoT] IoT Core limit of 100 transactions per second for each topic ? | AWS re:Post

answered a year ago

0

Hi Soms, Have you checked if the truncation is happening before the payload actually reaches AWS IoT Core — like in your Python script or device SDK? Also, are you using QoS 0 or 1? Sometimes SDKs or underlying libraries have internal buffer size limits, especially with retained or large messages. Let us know the SDK and method you're using to publish — someone here may have tackled the same limitation.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.