Please help me how to get updated data on mqtt server

Hello friend I’m studying the mqtt protocol
my project is to turn the room lights on and off with every button publish and subscribe
publish to send data values and subscribe to receive data but there is a problem when the application is disconnected with the subscriber data broker not being successfully updated
if anyone in the mqtt extension can request a request to the broker to update the missed data, I really need advice. thanks

I use the following extension
Ullis Roboter Seite/AI2 MQTT

hello friends is there anyone here who can help me about retained massages MQTT? i really need a block reference please maybe someone has applied it, thanks