Github user dlaboss commented on a diff in the pull request:
https://github.com/apache/incubator-quarks/pull/67#discussion_r58380932
--- Diff:
samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfSensors.java
---
@@ -109,6 +99,31 @@ public static void simulatedSensors(IotDevice device,
boolean print) {
// with event identifier "sensors".
device.events(sensors, "sensors", QoS.FIRE_AND_FORGET);
}
+
+ /**
+ * Create a heart beat device event with
+ * identifier {@code heartbeat} to
+ * ensure there is some immediate output and
+ * the connection to IoTF happens as soon as possible.
+ * @param device IoT device
+ */
+ public static void heartBeat(IotDevice device, boolean print) {
--- End diff --
Wondering about promoting (unncessary?) heartbeat messages. While
IotDevice isn't necessarily MQTT specific, MQTT has inherent mechanisms for
dealing with this sort of thing: KeepAlive and LastWillAndTestament.
Discussions
[here-on-stackoverflow](http://stackoverflow.com/questions/17270863/mqtt-what-is-the-purpose-or-usage-of-last-will-testament)
and
[here-on-hivemq](http://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament).
Perhaps IotDevice should include an interface for expressing this and impls do
what's needed to comply?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---