3 ms·
Yes, TCP already guarantees reliable byte streaming. However messages can get lost on higher levels: Some MQTT libraries or brokers will drop messages if they a
by Matthias247 7y ago
Yes, TCP already guarantees reliable byte streaming. However messages can get lost on higher levels: Some MQTT libraries or brokers will drop messages if they are out of memory of some internal queue is full. Or the application level software does the same or forgets to explicitly ACK a message (some MQTT libraries delegate all ACK sending to the user, and don't handle it in the library). In those cases the remote peer would want need to handle the missing ACK in a reasonable fashion.
- vinay_ys 7y agoWe can learn from the mechanisms applied by the TCP layer for reliable end to end packet transmission and adapt those mechanisms at application layer for reliable message delivery. For example, for any pair of applications that need to send/receive messages, they can efficiently keep track of sequential message ids that have been transmitted, and acknowledged, yet to be acknowledged, via a windowing mechanism. Then stop transmitting and wait for acks when the unack'ed message window is full, have timeout for these waits and reset the windows to recover and retransmit. We can have performance statistics that provide visibility without much fuss.
- jacques_chester 7y agoYou might be interested in RSocket: http://rsocket.io/ http://rsocket.io/