Preventing data loss on ESP32 during MQTT disconnects

Greetings every one what you do if you iot device infield get disconnected to wifi and you dont have anyother connectivity available?
How you can ensure that data is not lost has anyone did something like this on esp32
Was this page helpful?