[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Paho Java MQTT Client Reconnect Problem

James, who supports the Java client is working away at the moment, otherwise I'd ask him to help you.Â

Perhaps taking a trace of the Java client might shed more light on what is happening:

ÂÂÂ https://wiki.eclipse.org/Paho/Log_and_Debug_in_the_Java_client

(this is linked to from the client page on eclipse.org/paho)

Ian


On 04/07/2017 06:02, Karthik Jayanthi wrote:
Hi Ian,


The only thing I see in mosquitto logs is "Socket error on client, <client-name>, disconnecting".Â

Nothing much descriptive.Â


Thanks,
Karthik

On Thu, Jun 29, 2017 at 3:41 PM, Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

Does Mosquitto have any error in its log explaining why the client is being disconnected?


On 29/06/2017 03:44, Karthik Jayanthi wrote:
Hi,Â


We are trying to publish message with Qos 1, messages are being publish successfully but just after each publish client is getting connection lost callback (disconnecting) which was not there Âin case of when we were using Qos 0.Â

If you could guide us if anything more configuration require while dealing with Qos Â1 would be helpful. Our MQTT broker is vernemq. The same has been happening with Mosquitto as well. With a node.js client we did not see this connection lost coming in for either brokers. Tells us that, a configuration is missing in the code. Any help in fixing this will beÂreallyÂappreciated. Please let us know if you need anything else.Â

Below is the common configuration for both case.Â
MqttConnectOptions options = new MqttConnectOptions();
options.setUserName("ourusername");
options.setPassword("ourPassword");
options.setMqttVersion(MqttConnectOptions.MQTT_VERSION_3_1);
options.setAutomaticReconnect(false);
options.setCleanSession(false);
options.setKeepAliveInterval(900);
String tmpDir = System.getProperty("java.io.tmpdir");
MqttDefaultFilePersistence dataStore = new MqttDefaultFilePersistence(tmpDir);
MqttClient client = new MqttClient(url,client_id,dataStore);
client.setTimeToWait(15000);
client.connect(options);

MqttMessage message = new MqttMessage(ourPayload);
message.setQos(1); //0 and 1 /* working fine in case of 0*/
client.publish(ourtopic,message);
PS: Had to repost this as no concrete reply on the earlier thread.
Thanks,
Karthik


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev



_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto