Hello! I have a project relying on MQTT, where a payload is received by my project at 60hz. Everything is fine until periodically, callbacks stop executing for a second or two, then the cook time spikes and the on message callback will run a ton of times to catch up. This seems like messages are queuing but the messages pending property is 0 always.
Hi @abert
Is it always for the same period ? Do you have a test case with a broker we can setup on our end ?
Best,
Michel
Sure here’s an example, but it’s not quite as robust of an error as my actual setup here on my private network.
What I believe triggers the issue is when the callback of the mqtt client executes something that relies on the main touch thread. For example, if you parse a payload and the put it in a dat table or manipulate a count in a constant chop or store a value in the dat…
Would appreciate any info on how the ‘thread’ of the client dat interacts with the main touch network would be appreciated as well as any thoughts about workarounds. Thanks!!
mqtt.7.toe (8.2 KB)
Thanks for the sample.
I can’t seem to reproduce so far but I’ll play with it a bit more.
Best,
Michel
Would appreciate any info on how the ‘thread’ of the client dat interacts with the main touch network
We queue up callbacks from the mqtt calling thread that are then executed on the main thread during the cook.
I wasn’t able to reproduce the behavior myself, but upon investigation I saw one issue that could cause problems. It may or may not resolve your specific issue but it will at least improve how we queue/execute callbacks in the MQTT Client DAT. The fix will be in the next official build we release: 2023.11841+.