[SOLVED] MQTT 2.4 Speedy issue

Tags: #<Tag:0x00007fc20bc0d260>

Dejar community,
I need your help regarding the MQTT server in Opemhab 2.4
I implemented sucesfully the communication with Arduino where all sensors are connected. Everything was ok during testing phase but when I sent the 100 sensors data at high speed (around 500 per second ) the server after few minutes rejected all connectionns making impossible to reconnect. Is there any update limit on the MQTT server?
Thanks a lot

There’s an update limit on everything, though it might not be well defined.

You’re talking about the embedded MQTT broker I expect?

General comment; if you are trying to create some kind of real-time system, which 500 updates per second implies, you are probably using the wrong tool. openHAB is not a real-time system.

A stand alone MQTT broker like Mosquitto or HiveMQ can probably handle message rates that large (are we talking 500 message per second or 5000 messages per second?). I’d be surprised if the embedded broker can handle that. And as rossko57 indicates, OH can not handle that. You are essentially giving OH 2 msec to receive, parse, and process each message in order to keep up. OH simply cannot handle that. When you add in the fact that the processing is happening in parallel you will run into all sorts of problems with running out of threads and deadlock and events processing out of order. And that’s without even considering Rules.

Thanks a lot for your comments. Yes I was using the embedded broker. I will try the Mosquito as you mentioned can handle more messages. But any way always the OH reading from the Mosquito will be a limitation, correct?

Correct. OH isn’t a realtime system. It will never hope to handle messages that come in that fast.