Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Offline Buffering

Hello all,

As Ian listed Client offline buffering (ability to send while not connected) in Paho release roadmap, I would like to start design discussion before implementation.

Here are some items to consider and my opinion, please let me know your thoughts and provide comments..

* Buffer or not buffer
   - Use cleanSession flag
       ++ cleanSession=false indicates to buffer
       ++ cleanSession=true incicates not to buffer messages, clear buffer if exists

* QoS
    - Since MQTT protocol does not requires servers to forward publication at QoS=0 to a client, QoS=0 messages are not buffered
    - QoS=1 and QoS=2 messages are buffered.

* Resend
    Buffered messages are sent again with DUP flag set
 
* Max messages
    - The maximum number of messages to keep for a session (per connection)
        ++ Default is 5000 ???
    - The behavior applied when the buffer is full. That is, when the number of messages in the buffer reaches the Max Messages value.
        ++ Reject new messages:  While the buffer is full, new messages are rejected.
        ++ Discard old messages:  When the buffer is full and a new message arrives, the oldest un-delivered messages are discarded.

* Persist buffered messages
   - Have a flag for this??  Default is true. If persist flag is false, create buffer in memory




Regards,
Mike Tran


Back to the top