You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Connect to the MQTT Server
options.setAutomaticReconnect(true);
options.setCleanSession(true);
options.setConnectionTimeout(30);
options.setKeepAliveInterval(30);
options.setUserName(username);
options.setPassword(password.toCharArray());
options.setWill(NAMESPACE + "/" + groupId + "/NDEATH/" + edgeNode, deathBytes, 0, false);
client = new MqttClient(serverUrl, clientId);
client.setTimeToWait(2000);
client.setCallback(this); // short timeout on failure to connect
The deathBytes come from MetricHandler.getDeathPayloadBytes(). The issue is that by reusing the death payload, the nodes on the network cannot distinguish between an unexpected network disconnect, or a graceful shutdown.
The cleanest fix would most likely be to add a MetricHandler.getLWTPayloadBytes() (Last Will and Testament). The dirty hack would be to have everyone interested on the network check for a metric akin to GracefulShutdown, which I don't recommend.
The text was updated successfully, but these errors were encountered:
In
EdgeClient::connectToTargetServer
, we have the following block of code that is making the connection to the server:The
deathBytes
come fromMetricHandler.getDeathPayloadBytes()
. The issue is that by reusing the death payload, the nodes on the network cannot distinguish between an unexpected network disconnect, or a graceful shutdown.The cleanest fix would most likely be to add a
MetricHandler.getLWTPayloadBytes()
(Last Will and Testament). The dirty hack would be to have everyone interested on the network check for a metric akin toGracefulShutdown
, which I don't recommend.The text was updated successfully, but these errors were encountered: