Each client that subscribes to a topic pattern that matches the topic of the retained message receives the retained message immediately after they subscribe. The broker stores only one retained message per topic. (As explained by: https://www.hivemq.com/blog/mqtt-essent ... -messages/)
Retained messages help newly-subscribed clients get a status update immediately after they subscribe to a topic. The retained message eliminates the wait for the publishing clients to send the next update.
I made a small pull request on GitHub that works well for me: (It solves some "problems" of developing an application based on MQTT subscription)
https://github.com/cumulusmx/CumulusMX/pull/86
Davide