Thank you for your response.
In my project, I am using a Human Machine Interface (HMI) instead of a PC to run the MQTT broker, so the amount of data that can be stored in memory still has its limits.
I would like to ask, will the data stored in memory be automatically pushed to the subscribers after they reconnect, or is there a need for another method to retrieve and send the data?
Yes, that is correct. Since MQTT is not designed to be a database, but it acknowledges the problems of disconnecting, clients need to be able to have access to potentially missed information.
So QoS 1 & 2 hold information for a specific subscriber in the broker for the time needed. On reconnecting, all these messages will be sent and deleted from memory.
If you want to know a bit more about those principles, we have covered this in one of our courses in our MQTT academy: