4
votes

AWS Documentation here ( [http://docs.aws.amazon.com/iot/latest/developerguide/iot-message-broker.html] ) says this :-

"The message broker maintains a list of all client sessions and the subscriptions for each session. When a message is published on a topic, the broker checks for sessions with subscriptions that map to the topic. The broker then forwards the publish message to all sessions that have a currently connected client. For all matching sessions that do not have a connected client, the broker saves the message for delivery when the clients connect."

However, here ( [http://docs.aws.amazon.com/iot/latest/developerguide/protocols.html] ) it says this :-

"The message broker does not supports persistent sessions (clean session set to 0). All sessions are assumed to be clean sessions and messages are not stored across sessions. If an MQTT client sends a message with the clean session attribute set to false, the client will be disconnected."

This is a contradiction. Can Someone please elaborate and clarify. Thanks.

3

3 Answers

2
votes

AWS IoT now supports persistent connections which should meet your requirements. You can get more information at https://aws.amazon.com/about-aws/whats-new/2019/01/aws-iot-core-now-enables-customers-to-store-messages-for-disconnected-devices/

0
votes

AWS IoT does not support persistent sessions (clean session flag = 0) so it will not remember subscribed clients or undelivered messages after a client disconnects. It presumably takes this approach to minimize storing state in the broker which allows the AWS IoT solution to scale.

As of 30 November 2018, the documentation in your first link (https://docs.aws.amazon.com/iot/latest/developerguide/iot-message-broker.html) has been updated and only states:

The message broker maintains a list of all client sessions and the subscriptions for each session. When a message is published on a topic, the broker checks for sessions with subscriptions that map to the topic. The broker then forwards the publish message to all sessions that have a currently connected client.

-1
votes

The first part explains message delivery to subscribed clients and the mechanism to propagate the message when clients are connected and disconnected.

Persistent sessions means all messages sent to the broker are saved to disk or database, hence independent of client connections.