I'm using mosquitto broker and Paho client libraries in C. I want the broker to allow only a certain number of messages to be published and block any message above that number. I tried setting the max inflight messages option in the config to a certain number but it does not work. On the publisher side, I am reading some data from a file (line by line) and sending it in a for loop. Setting the max inflight messages in config does not work as the loop always goes through all the iterations and sends all the messages. Any ideas how to solve this?
Asked
Active
Viewed 853 times
1 Answers
0
The current version of mosquitto(1.4.10) doesn't allow you to limit number of messages from a client. You can limit the number of connections or message size but not number of messages.
Regarding max_inflight_messages, it's purpose is not to limit total number of messages. It is used to limit number of messges being retried or messages in handshake. Refer mosquitto.conf(1)

kiranpradeep
- 10,859
- 4
- 50
- 82