What is MAX message SIZE supported by Mosquitto / MQTT?

Asked by Lynton Grice

Hi there,

Forgive me if I am asking a stupid question as I have only just installed Mosquitto and did a very basic PUB / SUB using the "mosquitto_pub" and "mosquitto_sub" respectively.

I tried to send a 10MB PDF file to the subscriber but it onlt seemes to receive 3272 BYTES......

Here were my commands:

mosquitto_pub -t test/topic -f ./test.pdf

mosquitto_sub -t test/topic -q 1

What is the maximum message size that Mosquitto and MQTT support in general? If I can increase it to say 20MB's can you please let me know where I can do this?

Thanks for the help, much appreciated ;-)

Lynton

Question information

Language:
English Edit question
Status:
Solved
For:
mosquitto Edit question
Assignee:
No assignee Edit question
Solved by:
Lynton Grice
Solved:
Last query:
Last reply:
Revision history for this message
Roger Light (roger.light) said :
#1

The maximum message size is around 260MB so you're well within that. I suspect the problem you're seeing is that mosquitto_sub really only works for text messages. If you examine the pdf file it's quite likely that byte 3273 is equal to 0, so mosquitto_sub sees it as the end of a string and stops printing.

If you want to do file transfer, I'm afraid you'll have to write your own client for the moment.

Revision history for this message
Lynton Grice (lynton-grice) said :
#2

Hi Roger,

That is super....I was being stupid, I have been bitten by that '\0' many times before, sorry about that ;-)

I just sent a 34 MB message happily to a subscriber...great!

260 MB's is more that enough for now.....

Thanks again

Lynton