Change keep alive ratio to 1.5 from 0.75 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]. â Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/75a4e789 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/75a4e789 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/75a4e789 Branch: refs/heads/master Commit: 75a4e78948ba30e154bd0dafa86947052942ff47 Parents: 7d0d779 Author: Diego Bes <[email protected]> Authored: Fri Apr 29 08:43:25 2016 -0700 Committer: Martyn Taylor <[email protected]> Committed: Tue May 3 14:14:34 2016 +0100 ---------------------------------------------------------------------- .../activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/75a4e789/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java ---------------------------------------------------------------------- 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 57c2b57..306d146 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());
