In the project, mqtt is contacted by emqtt , when the number of messages is too large, you will be prompted
Disconnected (32109) - java.io.EOFException at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:181) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.EOFException at java.io.DataInputStream.readByte(DataInputStream.java:267) at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:92) at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:133) ... 8 more
I've tested countless times, and it turns out that it's not the cause of disconnection. As long as the data sent is less than 60kb, it's OK. It's measured in a little bit of database.
But this can't solve my problem. I need to send a message about 130KB, which contains the base64 image problem.
Find documents on the official website
https://docs.emqx.io/broker/v3/cn/config.html#mqtt
MQTT Maximum message size:
mqtt.max_packet_size = 1MB
Then I went to \ emqttd\etc\emq.conf and found the size.
## Maximum MQTT packet size allowed.
##
## Value: Bytes
##
## Default: 64K
mqtt.max_packet_size = 64KB
The actual limit is 64KB. Change the value to restart.
All right. Record it here.