john9x commented on code in PR #5785:
URL: https://github.com/apache/activemq-artemis/pull/5785#discussion_r2158114257


##########
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java:
##########
@@ -112,17 +112,18 @@ synchronized void connect(MqttConnectMessage connect, 
String validatedUser, Stri
          }
       }
 
+      int defaultMqttSessionExpiryInterval = 
session.getProtocolManager().getDefaultMqttSessionExpiryInterval();
       MqttProperties connackProperties;
       if (session.getVersion() == MQTTVersion.MQTT_5) {
          
session.getConnection().setReceiveMaximum(MQTTUtil.getProperty(Integer.class, 
connect.variableHeader().properties(), RECEIVE_MAXIMUM, -1));
 
-         
sessionState.setClientSessionExpiryInterval(MQTTUtil.getProperty(Integer.class, 
connect.variableHeader().properties(), SESSION_EXPIRY_INTERVAL, 0));
+         
sessionState.setClientSessionExpiryInterval(MQTTUtil.getProperty(Integer.class, 
connect.variableHeader().properties(), SESSION_EXPIRY_INTERVAL, 
defaultMqttSessionExpiryInterval));

Review Comment:
   @jbertram I have change it according to the documentation
   
   >The default defaultMqttSessionExpiryInterval is -1 which means no clean up 
will happen for MQTT 3.x clients or for MQTT 5 clients which do not pass their 
own session expiry interval.
   
   
   but MQTT 3.1.2.11.2 states
   
   >If the Session Expiry Interval is absent the value 0 is used. If it is set 
to 0, or is absent, the Session ends when the Network Connection is closed. 
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to