public class HeartBeat extends Object
|Modifier and Type||Method and Description|
Add IoT device heart beat processing to a topology.
public static TStream<com.google.gson.JsonObject> addHeartBeat(IotDevice iotDevice, long period, TimeUnit unit, String eventId)
An IoTDevice event containing heart beat information
is periodically published to the specified
The heart beat provides clients of the IoT hub with liveness information about the device and its connection to the hub.
The heart beat also ensures there is some immediate output so the connection to the IoT hub happens as soon as possible. In the case where there may not otherwise be IoT events to publish, a heart beat ensures a connection to the IoT hub is maintained.
The heart beat's event payload is the JSON for a JsonObject with the heart beat's properties:
iotDevice- IoT hub device
period- the heart beat period
unit- TimeUnit for the period
eventId- the IotDevice eventId to use for the event
Copyright © 2016–2017 The Apache Software Foundation. All rights reserved.