I am talking about publishing with qos >= 1 (and retain=0). The broker will store these messages to later deliver to a client that has gone offline.
To test, do the following:
1. Set the cleanSession parameter to 0 within the MQTT_InitClient function in user_int.
2. Subscribe to a topic by setting qos to 1 within MQTT_Subscribe function in mqttConnectedCb.
3. Start ESP8266 to execute the above, then remove power.
4. With the ESP8266 off, publish a few test messages to that MQTT topic with qos=1 flag set, using test software.
5. Startup the ESP8266. It should pick up those messages, but does not currently.
Tomorrow I'll try and post on my blog all the steps I followed for tests using the Paho client (i.e. not running on the ESP8266). Paho correctly picks up the stored messages when reconnecting.
[update] @tuanpm, here is the link. Please could you take a look? http://tinker.yeoman.com.au/2015/03/15/investigating-mqtt-persistence-in-an-iot-protocol-on-the-esp8266/