If you want that behavior, you should use cleansession=true. Then messages sent while your client is offline will not be delivered. If what you want is to have missed non-retained messages delivered, but only the latest retained message, the you're out of luck. Retained messages are handled just like any other message, except that additionally they are stored and delivered to new clients when they subscribe.
-Darren
This e-mail communication is confidential and legally privileged. If you are not the intended recipient, please notify me at the telephone number shown above or by return e-mail and delete this communication and any copy immediately. Thank you.--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at http://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.
Another similar but not identical approach is to implement Time To Live (TTL) on messages and age out the older stored messages. I don't think TTL is in the MQTT wire protocol either though so it would also be a non standard setup as well. Also you can still get more than one message at the subscriber this way unless the messages are published at a set consistent rate known to be in perfect sync with the time to live period.