|
|
|
|
|
by Groxx
4393 days ago
|
|
How do you know if you can handle the message, until you read the message? Or is MQTT's flow control inherently insufficient for cases like that? Basic example, say for a chat client: to ensure delivery, you probably want to read the message, save it to a database, then confirm receipt. Is that possible, or would that delayed-ack have to be done via some other means? |
|
What you don't want to do is read everything offered into memory faster than you can write it to disk / database. You could potentially fill the memory until you run out and crash. Instead control the flow by not reading until you are finished with the previous message (or better, allow N unacknowledged messages to be read, where N is just enough so that the application is as fast as it can be).