Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] MQTT reconnect logic

You don't need to subscribe again if

1) you connected non-cleansession, and
2) you reconnect non-cleansession

Ian

On 06/19/2014 12:10 PM, Parth Pandya wrote:

Yeah you do

On Jun 19, 2014 4:40 PM, "Bharath C" <Bharath.C@xxxxxxxxxxxxxxxxxxx> wrote:

Thanks for the reply.

Do I need to subscribe to the topic again.

 

Regards,

Bharath C.

 

From: paho-dev-bounces@xxxxxxxxxxx [mailto:paho-dev-bounces@xxxxxxxxxxx] On Behalf Of Parth Pandya
Sent: Thursday, June 19, 2014 4:35 PM
To: General development discussions for paho project
Subject: Re: [paho-dev] MQTT reconnect logic

 

Yes I do think it is required if you want to set any options.

On Jun 19, 2014 4:33 PM, "Bharath C" <Bharath.C@xxxxxxxxxxxxxxxxxxx> wrote:

Hi All,

 

While I reconnect means I’m assuming I need to call connect method again.

Do I did to pass mqttConnectOption parameters again.

 

My problem is when I have a mqttclient which can be configured with SSL or without. So in that case if

Its gets disconnect I need to call connect method again. Just wanted to confirm that connectionOption is also necessary.

 

Thanks a lot for excellent support.

 

Regards,

Bharath C.

 

From: paho-dev-bounces@xxxxxxxxxxx [mailto:paho-dev-bounces@xxxxxxxxxxx] On Behalf Of Marc L Cohen
Sent: Tuesday, June 10, 2014 8:16 PM
To: General development discussions for paho project
Subject: Re: [paho-dev] MQTT reconnect logic

 

You don't need to disconnect. The connection failure already caused a disconnect. All you should need to do is reconnect using the existing client.


Marc L. Cohen
MessageSight Test/Development
Internet:mlcohen@xxxxxxxxxx
also at:teddybbear@xxxxxxx
(512) 286-5744 (T/L 363-5744)
FAX (512) 973-4293


Inactive hide details for Bharath C
                        ---06/10/2014 09:17:02 AM---Thanks Marc .
                        connectionLost would be a the right way to do.
                        SBharath C ---06/10/2014 09:17:02 AM---Thanks Marc .  connectionLost would be a the right way to do. Since I’m using persistence client, I

From: Bharath C <Bharath.C@xxxxxxxxxxxxxxxxxxx>
To: General development discussions for paho project <paho-dev@xxxxxxxxxxx>
Date: 06/10/2014 09:17 AM
Subject: Re: [paho-dev] MQTT reconnect logic
Sent by: paho-dev-bounces@xxxxxxxxxxx





Thanks Marc .  connectionLost would be a the right way to do.
 
Since I’m using persistence client, I guess I need to disconnect first and the client using same parameters.
Just want to clarify.
 
 
I  came across this client http://mqtt-client.fusesource.org/
Which says it reconnects by itself. I would be gr8 if paho could provide it.
 
 
Regards,
Bharath.
 
From: paho-dev-bounces@xxxxxxxxxxx [mailto:paho-dev-bounces@xxxxxxxxxxx] On Behalf Of Marc L Cohen
Sent:
 Tuesday, June 10, 2014 7:30 PM
To:
 General development discussions for paho project
Subject:
 Re: [paho-dev] MQTT reconnect logic

 

You need to provide code to do the reconnect. I do that in the connectionLost method on the callback.


Marc L. Cohen
MessageSight Test/Development
Internet:mlcohen@xxxxxxxxxx
also at:teddybbear@xxxxxxx
(512) 286-5744 (T/L 363-5744)
FAX (512) 973-4293


Inactive hide details for Bharath C
                        ---06/10/2014 08:50:22 AM---Hi All, I need help
                        from you to understand reconnect logic.Bharath C ---06/10/2014 08:50:22 AM---Hi All, I need help from you to understand reconnect logic.

From:
Bharath C <Bharath.C@xxxxxxxxxxxxxxxxxxx>
To:
General development discussions for paho project <
paho-dev@xxxxxxxxxxx>
Date:
06/10/2014 08:50 AM
Subject:
[paho-dev] MQTT reconnect logic
Sent by:
paho-dev-bounces@xxxxxxxxxxx






Hi All,

I need help from you to understand reconnect logic.

Right now I’m using these components:
>>mosquito 1.2
>> Windows 7
>> Paho mqtt client java 0.4
>> Java 7, Spring 3.2.

Once the perisistence mqtt client gets disconnected (well I unplug my cable), then it throws an exception,

onnection lost (32109) - java.net.SocketTimeoutException: Read timed out
               at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:138)
               at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketTimeoutException: Read timed out


Later when I try to publish ,

com.lnt.ubiqrede.exception.UBIQRedeException: Error while sending Data,
               at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:27)
               at org.eclipse.paho.client.mqttv3.internal.ClientComms.sendNoWait(ClientComms.java:132)
               at org.eclipse.paho.client.mqttv3.MqttAsyncClient.publish(MqttAsyncClient.java:785)



Basicallt my doubt is if the mqtt client gets disconnected, does it tries to reconnect or we need to do it ourself.

Regards,
Bharath.

 

L&T Technology Services Ltd 

www.LntTechservices.com 

This Email may contain confidential or privileged information for the intended recipient (s). If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system._______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev

L&T Technology Services Ltd

www.LntTechservices.com

This Email may contain confidential or privileged information for the intended recipient (s). If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system._______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev

L&T Technology Services Ltd

www.LntTechservices.com

This Email may contain confidential or privileged information for the intended recipient (s). If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev

L&T Technology Services Ltd

www.LntTechservices.com

This Email may contain confidential or privileged information for the intended recipient (s). If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev



_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Committer on Paho, Mosquitto


Back to the top