eclipse-paho / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.14k stars 886 forks source link

Unable to connect via WebSocket when there is high network latency #979

Open sesu-bio opened 1 year ago

sesu-bio commented 1 year ago

Hi, we experience connection issues to MS Azure when using MQTT over WebSocket. I created this issue at the Azure IoT SDK and they suspect that the root cause lies within Paho.

The problem occurs reproducably when there is a network latency close to 300ms or higher. I attached a debug log. Pure MQTT (no WebSocket) works fine even with the latency.

To reproduce the problem in a testing environment, I use the following command on a Linux system to induce latency:

tc qdisc add dev usb0 root netem delay 300ms

The used Paho version is 1.2.5. I am unable to test the latest development snapshot. It seems like the java-parent is missing from the repository.

Could not find artifact org.eclipse.paho:java-parent:pom:1.2.6-SNAPSHOT in paho (https://repo.eclipse.org/content/repositories/paho-snapshots/)
Xerxekyran commented 1 year ago

I can also report to have this issue, blocking the usage of MQTT over WebSockets with MS Azure. Would highly appreciate a fix here. I could help if someone would know where to start or what possibly could be the issue here.

dazwi-bio commented 1 year ago

I was also able to reproduce this error by using MQTT over WebSockets in my test environment. This seems to be a relevant bug and should be handled with higher priority.