Disconnected client notifications
Disconnected client notifications can be used to notify disconnected clients that there are messages waiting on Eclipse Amlen.
When a client application is disconnected from Eclipse Amlen, but there are
messages waiting for that application, Eclipse Amlen can publish information
about those messages to a reserved system topic. An application that
uses MQTT with cleansession=1
can subscribe to the
system topic to receive information about the messages that are waiting
for the disconnected client. The provider can then process the information,
and take an appropriate action. For example, by sending an SMS message
to the disconnected client, or by forwarding the information to a
mobile operating system notification service.
Disconnected client notifications are enabled by configuring an
appropriate messaging policy that has the disconnected client notifications
option enabled. Any MQTT clients that use cleanSession=0
,
and subscribe by using the messaging policy, are monitored for disconnected
client notifications. For more information about configuring disconnected
client notifications, including creating applications to receive the
notifications, see Configuring disconnected client notifications.
- The client device registers with a mobile operating system vendor notification service.
- A client application on the device registers with a notification
provider, such as Worklight.
The notification provider uses an MQTT gateway or adapter to subscribe
to the reserved system topic
$SYS/DisconnectedClientNotification
on Eclipse Amlen. - When the client application is connected, and subscribes to a topic on Eclipse Amlen, the application receives messages as expected. This topic has an associated messaging policy that enables disconnected client notifications.
- When the client application disconnects, any messages that are published to that topic wait for delivery on Eclipse Amlen.
- Eclipse Amlen publishes
information about the waiting messages to the reserved system topic
$SYS/DisconnectedClientNotification
. - The notification provider processes the information that was published
on
$SYS/DisconnectedClientNotification
and calls the notification service. This notification is then sent to the disconnected client to alert the client about the waiting messages.