Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » How to resolve org.eclipse.paho.client.mqttv3.internal.ClientState.checkForActivity issue of mqtt
How to resolve org.eclipse.paho.client.mqttv3.internal.ClientState.checkForActivity issue of mqtt [message #1760536] Fri, 28 April 2017 07:38
Tushar Patil is currently offline Tushar PatilFriend
Messages: 1
Registered: April 2017
Junior Member
I have written mqtt client in java for mosquitto broker . it works for while but after sometime if there is no traffic between my client and mqtt broker it gets disconnected with following error:

org.eclipse.paho.client.mqttv3.internal.ClientState.checkForActivity : Timed out as no activity, keepAlive=30,000 lastOutboundActivity=1,493,194,287,903 lastInboundActivity=1,493,194,270,964 time=1,493,194,317,903 lastPing=1,493,194,287,903

How do i stay connected to mqtt broker continuously? what configuration settings do i need to make ?
-------------------------------------------------------------------------------------------------------
My current configuration of mqtt client are (following is just a snippet):

final String brokerUrl = AppProperties.getProperty(AppConstants.MQTT_BROKER);
final String clientId = "";
final String topic = AppProperties.getProperty(AppConstants.MQTT_TOPIC);
MemoryPersistence persistence = new MemoryPersistence();

try {

MqttClient sampleClient = new MqttClient(brokerUrl, clientId, persistence);
MqttConnectOptions connOpts = new MqttConnectOptions();
connOpts.setCleanSession(true);
sampleClient.setCallback(this);
if(!sampleClient.isConnected()){
sampleClient.connect(connOpts);
}
LOGGER.info("Mqtt Connected to broker: "+ brokerUrl);


sampleClient.subscribe(topic);

LOGGER.info("Subscribed");
LOGGER.info("Listening");

}

------------------------------------------------------------------------------------------------------------
Any help is appreciated. Thank you.
Previous Topic:C# MQTT Auto Reconnect
Next Topic:Experiencing constant reconnects with paho client v1.1.1 and broker Active MQ 5.14.3
Goto Forum:
  


Current Time: Sat Sep 22 22:43:50 GMT 2018

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

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

Back to the top