Configuring disconnected client notifications
To configure disconnected client notifications, you must configure Eclipse Amlen and a notification provider. You can use notification providers such as Worklight®, or you can create your own MQTT application to handle the notifications.
Configuring Eclipse Amlen for disconnected client notifications
To configure Eclipse Amlen for disconnected client
notifications, you must create a topic policy that sets the
DisconnectedClientNotification
option to true. Any MQTT application that
uses cleansession=0
, and subscribes to a topic that is controlled by a
messaging policy with DisconnectedClientNotification=True
, is then
monitored for disconnected client notifications.
For more information about configuring messaging policies, see Configuring message hubs.
Creating an MQTT application to receive disconnected client notifications
You can create an MQTT application
to receive disconnected client notifications. The MQTT application
must be configured to do the following things:
- Connect to Eclipse Amlen using
cleanSession=1
- Subscribe to the reserved system topic:
$SYS/DisconnectedClientNotification
Note: Applications are not permitted to create a shared subscription to the disconnected notification topic. - Process the published notifications. The notifications are published
in JSON format, and include the user ID, client ID, and an array of
topic strings and number of waiting messages. The following example
shows a notification message for a client:
{ "ClientId":"MyPhone", "UserID":"Tom", "MessagesArrived": [ { "TopicString":"/News/City/Austin", "MessageCount":"3" }, { "TopicString":"/News/Breaking", "MessageCount":"1" } ] }