I am currently hunting for a MQTT OSS Library and also checked out async-mqtt5. Currently I am using paho-mqtt-cpp which has some drawbacks which is why I am looking for alternatives.
General:
I love the automatic connection handling but I'd really like some callbacks when no connection can be established to be able to report this to a UI or Logs.
Specific:
I run into an issue where on Windows + Localhost with a mosuqitto broker in between the latency is >100ms
Beneath you can find some shortened testing code, this is embeddedin a larger application but (hopefully) shows all the relevant calls.
I use this across two processes with a mosquitto broker in the middle (mosquitto version 2.0.15).
The two processes play ping pong with messages and I measure the time between after the async_publish call until the received handler is called.
Example Payload:
{
"discriminator": "SomePayload",
"payload": "This is a message"
}
This comes out to be roughly: 120ms which seems extremely long. Plugging in paho-mqtt-cpp, instead I get around 3ms.
On Docker(WSL) I get around 50ms with the mosquitto broker and 15ms with EMQX, this is where paho-mqtt-cpp has issues and reports 100ms. (Same code on both machines, using Clang/MSVC respectively)
Any ideas where this long time could be coming from?
Hey there,
I am currently hunting for a MQTT OSS Library and also checked out async-mqtt5. Currently I am using paho-mqtt-cpp which has some drawbacks which is why I am looking for alternatives.
General: I love the automatic connection handling but I'd really like some callbacks when no connection can be established to be able to report this to a UI or Logs.
Specific: I run into an issue where on Windows + Localhost with a mosuqitto broker in between the latency is
>100ms
Beneath you can find some shortened testing code, this is embeddedin a larger application but (hopefully) shows all the relevant calls.
I use this across two processes with a mosquitto broker in the middle (
mosquitto version 2.0.15
).The two processes play ping pong with messages and I measure the time between after the
async_publish
call until the received handler is called.Example Payload:
This comes out to be roughly:
120ms
which seems extremely long. Plugging in paho-mqtt-cpp, instead I get around3ms
. On Docker(WSL) I get around50ms
with the mosquitto broker and15ms
with EMQX, this is where paho-mqtt-cpp has issues and reports100ms
. (Same code on both machines, using Clang/MSVC respectively)Any ideas where this long time could be coming from?