Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] "Offline Buffering" for Paho Clients

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.

The Eclipse Kura project has an ostensibly protocol-neutral approach to this for Java, although currently I think it implements MQTT only. One of the main interfaces is here:

I think it would be good to add offline buffering for the Paho clients, but what approach to take?

- for Java, just adopt or adapt the Kura implementation somehow? Just say, use Kura? Or have a more minimal implementation which varies less from the current Java API?
- for the others, adopt a Kura-like interface or something more minimal?

I am thinking that the most minimal implementation would simply allow calling publish regardless of if a connection was available, with a limit on the number of stored messages.


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

Back to the top