Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Unusable token with aynchronous library (MQTTAsync) ?

Nicolas,

in all the current Paho clients, you can only publish a message when the client is connected.   I wrote a recent message to this mailing list explaining why:

"One thing that is quite frequently asked about the Paho MQTT clients is why can't the application publish messages when not connected to a broker.  This seems like an obvious thing to be able to do.

I think the main reason, is that that is the way we have developed MQTT clients for as far back as I remember.    But that ability does raise other questions for the API implementation, such as:

- how to manage the stored messages (what if the connection information is wrong and no messages ever get sent, limiting the storage used, etc)
- how frequently and when to attempt reconnection to the broker

so we have avoided the problem by letting the application handle it."

It's a suggested improvement for the APIs, maybe for the next release.

Ian


On 18/07/14 08:58, Nicolas GAUTHIER wrote:
The token is returned in MQTTAsync_successData and MQTTAsync_failureData structures, but there is no way to get it before sending. The best shot that i see is to use the void* context parameter.
Another point : in our application, with asynchronous mechanisms, we call publish() function before being connected (always in QoS 1). Theses messages are not sent nor kept but just dropped.
Should I manage this point manually ? Store messages then send them after connectSuccess only ?


De: "Andy Piper" <andypiperuk@xxxxxxxxx>
À: "General development discussions for paho project" <paho-dev@xxxxxxxxxxx>
Envoyé: Jeudi 17 Juillet 2014 18:11:13
Objet: Re: [paho-dev] Unusable token with aynchronous library (MQTTAsync) ?

Probably document as deprecated and remove in v.Next


On Thu, Jul 17, 2014 at 5:00 PM, Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi Nicolaus,

no, the token in MQTTAsync_responseOptions is not used.  That seems to be a leftover from an previous design, which needs to be removed or documented as unused.  The token which you can use to refer to a request is returned in the MQTTAsync_successData structure as a parameter to the MQTTAsync_onSuccess callback.

Ian


On 07/17/2014 04:07 PM, Nicolas GAUTHIER wrote:
Hello

I'm using the asynchronous library of Paho and have an issue to check sended message with tokens. As I see, token specified in MQTTAsync_responseOptions struct is not used by the library.
Do I miss something ?

Thank you.
_______________________________________________
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
Committer on Paho, 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



--
Andy Piper | Kingston upon Thames, London (UK)
blog: http://andypiper.co.uk   |   skype: andypiperuk
twitter: @andypiper  |  images: http://www.flickr.com/photos/andypiper

_______________________________________________
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


Back to the top