Skip to main content



      Home
Home » Eclipse Projects » Paho » Paho Java Client disoconnects and reconnects constantly(Paho Java Client is tryign to autoreconnect, but broker throws out error saying Another client connected with the same client id.. )
Paho Java Client disoconnects and reconnects constantly [message #1837723] Thu, 04 February 2021 13:30
Eclipse UserFriend
I am using Paho Java client library mqttV3 of version 1.2.5. ot connect to HiveMq

Here are the connection options I am using in my client code.

MqttConnectOptions conOpt = new MqttConnectOptions();
conOpt.setCleanSession(false);
conOpt.setKeepAliveInterval(2);
conOpt.setAutomaticReconnect(true);
conOpt.setUserName("somename");
conOpt.setPassword("somepassword");

So, The client started getting disconnected after an hour of its first connection and connecting back in sometime and this process is constantly repeating.
when I look at Hive logs the first disconnection happened because:
reason: Client was idle for too long
And then when it reconnected, it throws up another message on Hive logs which says
reason: Another client connected with the same client id.

After this there are constant disconnections as same client Id is being used to connect it back to back .

Wanted to know whether the autoreconnect after keep alive time elapse tried to make fresh connection with hive with same clientId.

Hoping to hear an answer to this as soon as possible.

Thanks&Regards,
Rehana
Previous Topic:How to publish N messages per second from paho c publisher
Next Topic:TLS 1.3 support with C client
Goto Forum:
  


Current Time: Fri Jun 20 04:27:26 EDT 2025

Powered by FUDForum. Page generated in 0.05592 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top