Author |
Message
|
boristep |
Posted: Wed Apr 06, 2016 3:41 am Post subject: mqtt android client - republish message on disconnect |
|
|
Novice
Joined: 02 Jan 2013 Posts: 11
|
We have to publish messages from MQTT clients (Android) with unstable connection. What is a right way to resend a message from a client that lost its connection to the server and can't connect at the moment? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Apr 06, 2016 5:04 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
boristep |
Posted: Thu Apr 07, 2016 12:00 am Post subject: |
|
|
Novice
Joined: 02 Jan 2013 Posts: 11
|
I use Paho Java Client. Does this client have this functionality or I have to implement it in the application? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 07, 2016 4:22 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
boristep wrote: |
I use Paho Java Client. Does this client have this functionality or I have to implement it in the application? |
The link I posted is for the official specification of the MQTT protocol, not for information about a specific client.
The paho client will work the same way as any other client that implements the full and correct spec. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
boristep |
Posted: Thu Apr 07, 2016 4:28 am Post subject: |
|
|
Novice
Joined: 02 Jan 2013 Posts: 11
|
Thank you mqjeff
Actually the question is how I implement this functionality using Paho Java Client? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 07, 2016 4:30 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
boristep wrote: |
Thank you mqjeff
Actually the question is how I implement this functionality using Paho Java Client? |
Don't use cleanSession.
That's it.
I mean set cleanSession to false, unless your paho client knows that it needs to discard any messages that haven't been delivered in either direction (after some kind of device reset for example). _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
|