Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] [Looking for help] send payloads of more than 10 MB

Hi Steve,

What version are you running on? It makes it much easier to diagnose
any problems.

I'd suggest trying with mosquitto_pub and mosquitto_sub for comparison.

This sub command will print out the topic and payload length for all
messages received:

mosquitto_sub -h <your broker address> -t '#' -F "%t %l" -q 1

And this pub command will let you send a file, so it's easy to
generate a big message:

mosquitto_pub -h <your broker address> -t test -f large-file -q 1

I tried this:

mosquitto_pub -t test -f /usr/lib/x86_64-linux-gnu/libwireshark.so.13.0.7 -q 1

And got this from mosquitto_sub, which is the correct size, and over 90MB:

$ mosquitto_sub -t \# -F "%t %l" -q 2
test 92944744

The 256MB limit comes from the MQTT specification by the way, it's not
mosquitto imposing the limit :)

Regards,

Roger


On Sat, 29 May 2021 at 03:41, Hawk Steve <centaurus_alpha@xxxxxxxxxxx> wrote:
>
> Greetings! I'm new to eclipse mosquitto. I'm using libmosquitto to send payloads of more than 10 MB, and I have encountered with some problems. I set message_size_limit to 0 in the .conf file, and I test pub/sub with payloads from around 100 Bytes to 10 MB. My test runs OK for payload of less than several MB. However, when I test with payload of 11.7 MB, it seems that the subscriber cannot receive anything from broker. My test class is inherited from  mosqpp::mosquittopp. I use NULL client id while connecting to the broker, and keepalive is set to 60s. The outcoming is as follows:
>
>  Broker received PUBLISH from pub with QoS 1, and PUBACK from broker is sent back to pub;
>  Broker sent PUBLISH to sub (QoS 1), however on_message() callback in sub was never triggered, and PUBACK from sub to broker was never received;
>  After one minite, broker found sub closed its commection, and then sub reconnected to broker.
>
> I've noticed that mosquitto imposes a maximum payload size of about 268 MB.  Is there anything I need to check up in my code? Thanks a lot for your attention and kindly help! All my best wishes!
>
> David
>
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev


Back to the top