Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Paho Mqtt Client Issue

Hello, 
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. 

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);

--
Thanks

Deepak Kumhar
Associate Tech ( Mobile Team )
Delhivery HQ

("Eat code before they debug it ... Learn And implement")


Back to the top