paho.mqtt.java icon indicating copy to clipboard operation
paho.mqtt.java copied to clipboard

Timed out waiting for a response from the server

Open kingflyok opened this issue 4 years ago • 8 comments

I use IMqttAsyncClient, which throws an exception in the setCallback function

2020-06-06T07:39:07.217382883Z 2020-06-06 15:39:07.217 ERROR 1 --- [1f-9308a60f67bd] o.e.p.c.mqttv3.internal.ClientState : 7e12cfaf-7734-40d3-ad1f-9308a60f67bd: Timed out as no activity, keepAlive=60,000,000,000 lastOutboundActivity=3,702,800,591,221,505 lastInboundActivity=3,702,740,659,674,271 time=3,702,860,591,244,376 lastPing=3,702,800,591,224,053 2020-06-06T07:39:07.227207116Z 2020-06-06 15:39:07.226 INFO 1 --- [1f-9308a60f67bd] com.kunyue.mqtt.mqtt.OnMessageCallback : 客户端断开:{} 2020-06-06T07:39:07.227239180Z 2020-06-06T07:39:07.227244435Z org.eclipse.paho.client.mqttv3.MqttException: Timed out waiting for a response from the server 2020-06-06T07:39:07.227248742Z at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31) ~[org.eclipse.paho.client.mqttv3-1.2.2.jar!/:na] 2020-06-06T07:39:07.227253125Z at org.eclipse.paho.client.mqttv3.internal.ClientState.checkForActivity(ClientState.java:741) ~[org.eclipse.paho.client.mqttv3-1.2.2.jar!/:na] 2020-06-06T07:39:07.227257127Z at org.eclipse.paho.client.mqttv3.internal.ClientComms.checkForActivity(ClientComms.java:816) [org.eclipse.paho.client.mqttv3-1.2.2.jar!/:na] 2020-06-06T07:39:07.227269238Z at org.eclipse.paho.client.mqttv3.internal.ClientComms.checkForActivity(ClientComms.java:802) [org.eclipse.paho.client.mqttv3-1.2.2.jar!/:na] 2020-06-06T07:39:07.227272648Z at org.eclipse.paho.client.mqttv3.TimerPingSender$PingTask.run(TimerPingSender.java:79) [org.eclipse.paho.client.mqttv3-1.2.2.jar!/:na] 2020-06-06T07:39:07.227276759Z at java.util.TimerThread.mainLoop(Timer.java:555) [na:1.8.0_212] 2020-06-06T07:39:07.227280924Z at java.util.TimerThread.run(Timer.java:505) [na:1.8.0_212] 2020-06-06T07:39:07.227284558Z

kingflyok avatar Jun 06 '20 09:06 kingflyok

@kingflyok hello,I have encountered the same problem. Do you have any good suggestions for me? Thank you. . .

zhangdaopin avatar Aug 05 '20 01:08 zhangdaopin

it happended to me too

Jakecy avatar Sep 14 '20 03:09 Jakecy

it happens to me too... I used to use node mqtt-client, connected to the same server, actually it never lost connection. But changed to paho, it lost connection many times a day, which forced me to call system.exit(0). I'm using k8s container, which will restart when process exit... I've checked the mqtt-server, it has been online for more than a year, and other ARM devices connected almost never lost, or much more less than paho...

thkdog avatar Sep 26 '20 16:09 thkdog

This is a burning issue. We are facing this issue in our prod environment, when and why this happens nobody knows. It's a serious critical problem, please anybody from the developer team look into this on priority.

ramyakbhatt avatar Oct 13 '20 03:10 ramyakbhatt

I had the exact same problem when many messages where queued at the broker for this client. Changing the client id so that the client won't get the queued messages "fixes" it, but then of course the queued messages are lost!

Switching from Paho to the HiveMQ MQTT Client properly fixed this problem, so there is definitely a bug in Paho causing this problems!

J0s3f avatar Oct 27 '20 20:10 J0s3f

@kingflyok hello,I have encountered the same problem. Do you have any good suggestions for me? Thank you. . .

When we were doing a 72-hour stability test, we still found that after running smoothly for a period of time (approximately), our clients connected to EMQXbroker(4.2.3) began to disconnect frequently, then reconnected, and then disconnected again. . . . image

zhangdaopin avatar Feb 05 '21 05:02 zhangdaopin

it happended to me too。

liushengbin avatar Oct 09 '22 07:10 liushengbin

we are experiencing same issue. was there any fix ?

kondubhSICKAG avatar Aug 23 '23 20:08 kondubhSICKAG