Open inad9300 opened 4 months ago
In your PR I commented on your test to explain why you run into this behavior. It is basically caused by a threading problem in the test code and is not an issue of the library. Feel free to comment and ask for clarifications.
Could you please reopen this until fully solved? I fear it'll go unnoticed otherwise.
Hi @inad9300 - you're right - we'll close this issue after the discussion in #619 is complete. @SgtSilvio should loop back soon.
🐛 Bug Report
I have a setup where I receive messages from a MQTTv5 broker at a rate of one per second, and have to forward them to a MQTTv3 broker. As such, I have a software component with two clients, one connected to each broker, using the asynchronous API flavor.
In this scenario, the MQTTv5 client receives all messages well, but sending those same messages through the MQTTv3 client behaves in such a way that the sending of 8 consecutive messages works, then the 9th times out, repeatedly.
🔬 How To Reproduce
I have added a test case reproducing the problem in https://github.com/hivemq/hivemq-mqtt-client/pull/619. It shows how the reactive API flavor handles the task well, whereas the asynchronous one is only able to send a few messages before breaking. I have not added a test using the blocking API, but I have been able to test it in my own project and it works too.
I believe the same problem exists when going from MQTTv3 to MQTTv5. Perhaps the version does not matter. I also don't know if two async clients are necessary to reproduce the issue. These are all tests worth doing and automating, in my opinion.
Environment
Ubuntu 22.04.
📈 Expected behavior
All messages should arrive, as is the case with the other API flavors.