From 75a4e78948ba30e154bd0dafa86947052942ff47 Mon Sep 17 00:00:00 2001 From: Diego Bes Date: Fri, 29 Apr 2016 08:43:25 -0700 Subject: [PATCH] Change keep alive ratio to 1.5 from 0.75 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: ARTEMIS-397 From mqtt specs: “If the Keep Alive value is non-zero and the Server does not receive a Control Packet from the Client within one and a half times the Keep Alive time period, it MUST disconnect the Network Connection to the Client as if the network had failed [MQTT-3.1.2-24]. “ --- .../artemis/core/protocol/mqtt/MQTTProtocolHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java index 57c2b57c63..306d1467f1 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java @@ -156,7 +156,7 @@ public class MQTTProtocolHandler extends ChannelInboundHandlerAdapter { */ void handleConnect(MqttConnectMessage connect, ChannelHandlerContext ctx) throws Exception { this.ctx = ctx; - connectionEntry.ttl = connect.variableHeader().keepAliveTimeSeconds() * 750; + connectionEntry.ttl = connect.variableHeader().keepAliveTimeSeconds() * 1500; String clientId = connect.payload().clientIdentifier(); session.getConnectionManager().connect(clientId, connect.payload().userName(), connect.payload().password(), connect.variableHeader().isWillFlag(), connect.payload().willMessage(), connect.payload().willTopic(), connect.variableHeader().isWillRetain(), connect.variableHeader().willQos(), connect.variableHeader().isCleanSession());