Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] [iot-wg] Questions regarding MQTT/Paho

Hi Jens,

what Benjamin says is correct. It is a manual step to reconnect in the callback. This is for a number of reasons.

1. MQTT is defined as a protocol rather than an API, so the APIs have been written to be close to the behaviour of MQTT. This makes it easy to understand the APIs in the context of MQTT, and provides maximum flexibility.

2. Depending on the connect options used, will message or clean session for instance, disconnection and reconnection can have effects which you need to know about and/or control. You may want to change connect options when you reconnect, or delay reconnection. To allow all these combinations on automatic reconnection would require a complicated API.


On 07/25/2014 02:08 PM, Benjamin Cabé wrote:
Hi Jens,

I think you may want to post this question on the paho-dev mailing list (I
cross-posted there)!
My understanding though is that when the MqttCallback#connectionLost()
method is called, it's up to you to decide whether you want to reconnect
or not.


Le 25/07/2014 14:47, « Jens Reimann » <jens.reimann@xxxxxxxxxxxxxxx> a
écrit :


maybe somebody can give me a short hint about the MqttAsyncClient from

I found the javadoc, and know how to connect and disconnect. What I
don't know is, what will happen when the connection breaks. Does it
automatically re-connect, or is this a "manual" step?

Thanks for helping


D-85235 Pfaffenhofen an der Glonn
Läutenring 43
Geschäftsführer / CEO: Dr. Thomas Heitzig

Amtsgericht München
Handelsregister Nummer  HRB 197959
USt ID: DE267945175

Office Munich
D 80992 München
Agnes-Pockels-Bogen 1
T +49 89 18 9 17 49 0

The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or pivileged
material. Any review, retransmission, dissemination or other use of,
or taking of any action in reliance upon, this information by persons
or entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer.

iot-wg mailing list
To change your delivery options, retrieve your password, or unsubscribe
>from this list, visit

iot-wg mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

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

Back to the top