public class HeartBeat
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static TStream<com.google.gson.JsonObject> |
addHeartBeat(IotDevice iotDevice,
long period,
java.util.concurrent.TimeUnit unit,
java.lang.String eventId)
Add IoT device heart beat processing to a topology.
|
public static TStream<com.google.gson.JsonObject> addHeartBeat(IotDevice iotDevice, long period, java.util.concurrent.TimeUnit unit, java.lang.String eventId)
An IoTDevice event containing heart beat information
is periodically published to the specified eventId
.
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:
System.currentTimeMillis()
iotDevice
- IoT hub deviceperiod
- the heart beat periodunit
- TimeUnit for the periodeventId
- the IotDevice eventId to use for the eventTStream<JsonObject>
heartbeat streamCopyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641