From 837752a24337198ca4f45d0b3db2129f46cd0cda Mon Sep 17 00:00:00 2001 From: dashevchenko Date: Wed, 17 Jan 2024 14:55:00 +0200 Subject: [PATCH 1/2] updated transport.sessions.inactivity_timeout default value, updated desc for some params --- application/src/main/resources/thingsboard.yml | 12 +++++++++--- .../coap/src/main/resources/tb-coap-transport.yml | 8 ++++++-- .../http/src/main/resources/tb-http-transport.yml | 8 ++++++-- .../lwm2m/src/main/resources/tb-lwm2m-transport.yml | 8 ++++++-- .../mqtt/src/main/resources/tb-mqtt-transport.yml | 8 ++++++-- .../snmp/src/main/resources/tb-snmp-transport.yml | 8 ++++++-- 6 files changed, 39 insertions(+), 13 deletions(-) diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index 2f710f3e92..8259dcf4bf 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -777,7 +777,9 @@ audit-log: # Device state parameters state: - # Should be greater than transport.sessions.report_timeout + # Defines when the device state will be marked as "inactive" by server. + # We recommend this parameter to be in sync with transport.sessions.inactivity_timeout + # (transport timeout should be equal to or greater than current parameter; if not, you can get the situation when the session is closed for the active device). defaultInactivityTimeoutInSec: "${DEFAULT_INACTIVITY_TIMEOUT:600}" defaultStateCheckIntervalInSec: "${DEFAULT_STATE_CHECK_INTERVAL:60}" # Interval for checking the device state after a specified period. Time in seconds # Controls whether we store the device 'active' flag in attributes (default) or telemetry. @@ -866,8 +868,12 @@ js: # Transport configuration parameters transport: sessions: - # Inactivity timeout for device session in transport service. The last activity time of the device session is updated if the device sends any message, including keepalive messages - inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:300000}" + # Parameter defines how long the device transport session will be opened after the last activity time. + # The last activity time of the device session is updated if the device sends any message, including keepalive messages + # If there is no activity, the session will be closed, and all subscriptions will be deleted. + # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec + # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" activity: diff --git a/transport/coap/src/main/resources/tb-coap-transport.yml b/transport/coap/src/main/resources/tb-coap-transport.yml index ff4c0ea534..a0e21134c6 100644 --- a/transport/coap/src/main/resources/tb-coap-transport.yml +++ b/transport/coap/src/main/resources/tb-coap-transport.yml @@ -175,8 +175,12 @@ transport: # Interval of periodic eviction of the timed-out DTLS sessions dtls_session_report_timeout: "${TB_COAP_X509_DTLS_SESSION_REPORT_TIMEOUT:1800000}" sessions: - # Inactivity timeout for device session in transport service. The last activity time of the device session is updated if the device sends any message, including keepalive messages - inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:300000}" + # Parameter defines how long the device transport session will be opened after the last activity time. + # The last activity time of the device session is updated if the device sends any message, including keepalive messages + # If there is no activity, the session will be closed, and all subscriptions will be deleted. + # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec + # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" json: diff --git a/transport/http/src/main/resources/tb-http-transport.yml b/transport/http/src/main/resources/tb-http-transport.yml index 83b0828386..cfcf546556 100644 --- a/transport/http/src/main/resources/tb-http-transport.yml +++ b/transport/http/src/main/resources/tb-http-transport.yml @@ -160,8 +160,12 @@ transport: # HTTP maximum request processing timeout in milliseconds max_request_timeout: "${HTTP_MAX_REQUEST_TIMEOUT:300000}" sessions: - # Inactivity timeout for device session in transport service. The last activity time of the device session is updated if device sends any message, including keepalive messages - inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:300000}" + # Parameter defines how long the device transport session will be opened after the last activity time. + # The last activity time of the device session is updated if the device sends any message, including keepalive messages + # If there is no activity, the session will be closed, and all subscriptions will be deleted. + # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec + # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" json: diff --git a/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml b/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml index bfd490aa66..46be8b8942 100644 --- a/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml +++ b/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml @@ -122,8 +122,12 @@ redis: # LWM2M server parameters transport: sessions: - # Inactivity timeout for device session in transport service. The last activity time of the device session is updated if the device sends any message, including keepalive messages - inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:300000}" + # Parameter defines how long the device transport session will be opened after the last activity time. + # The last activity time of the device session is updated if the device sends any message, including keepalive messages + # If there is no activity, the session will be closed, and all subscriptions will be deleted. + # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec + # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" json: diff --git a/transport/mqtt/src/main/resources/tb-mqtt-transport.yml b/transport/mqtt/src/main/resources/tb-mqtt-transport.yml index a2ffda28d9..21532952e3 100644 --- a/transport/mqtt/src/main/resources/tb-mqtt-transport.yml +++ b/transport/mqtt/src/main/resources/tb-mqtt-transport.yml @@ -181,8 +181,12 @@ transport: # Skip certificate validity check for client certificates. skip_validity_check_for_client_cert: "${MQTT_SSL_SKIP_VALIDITY_CHECK_FOR_CLIENT_CERT:false}" sessions: - # Inactivity timeout for device session in transport service. The last activity time of the device session is updated if the device sends any message, including keepalive messages - inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:300000}" + # Parameter defines how long the device transport session will be opened after the last activity time. + # The last activity time of the device session is updated if the device sends any message, including keepalive messages + # If there is no activity, the session will be closed, and all subscriptions will be deleted. + # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec + # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" json: diff --git a/transport/snmp/src/main/resources/tb-snmp-transport.yml b/transport/snmp/src/main/resources/tb-snmp-transport.yml index 6a055f83a4..9858fd5c8a 100644 --- a/transport/snmp/src/main/resources/tb-snmp-transport.yml +++ b/transport/snmp/src/main/resources/tb-snmp-transport.yml @@ -137,8 +137,12 @@ transport: # To ignore SNMP response values that do not match the data type of the configured OID mapping (by default false - will throw an error if any value of the response not match configured data types) ignore_type_cast_errors: "${SNMP_RESPONSE_IGNORE_TYPE_CAST_ERRORS:false}" sessions: - # Inactivity timeout for device session in transport service. The last activity time of the device session is updated if the device sends any message, including keepalive messages - inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:300000}" + # Parameter defines how long the device transport session will be opened after the last activity time. + # The last activity time of the device session is updated if the device sends any message, including keepalive messages + # If there is no activity, the session will be closed, and all subscriptions will be deleted. + # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec + # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" json: From 539bbda23f99f6bbebae2a3dbe72b155980cfeff Mon Sep 17 00:00:00 2001 From: dashevchenko Date: Thu, 18 Jan 2024 13:21:27 +0200 Subject: [PATCH 2/2] updated descriptions --- application/src/main/resources/thingsboard.yml | 18 ++++++++++++------ .../src/main/resources/tb-coap-transport.yml | 9 ++++++--- .../src/main/resources/tb-http-transport.yml | 9 ++++++--- .../src/main/resources/tb-lwm2m-transport.yml | 9 ++++++--- .../src/main/resources/tb-mqtt-transport.yml | 9 ++++++--- .../src/main/resources/tb-snmp-transport.yml | 9 ++++++--- 6 files changed, 42 insertions(+), 21 deletions(-) diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index 8259dcf4bf..936f30af60 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -777,9 +777,12 @@ audit-log: # Device state parameters state: - # Defines when the device state will be marked as "inactive" by server. - # We recommend this parameter to be in sync with transport.sessions.inactivity_timeout - # (transport timeout should be equal to or greater than current parameter; if not, you can get the situation when the session is closed for the active device). + # Device inactivity timeout is a global configuration parameter that defines when the device will be marked as "inactive" by the server. + # The parameter value is in seconds. A user can overwrite this parameter for an individual device by setting the “inactivityTimeout” server-side attribute (NOTE: expects value in milliseconds). + # We recommend this parameter to be in sync with session inactivity timeout ("transport.sessions.inactivity_timeout" or TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT) parameter + # which is responsible for detection of the stale device connection sessions. + # The value of the session inactivity timeout parameter should be greater or equal to the device inactivity timeout. + # Note that the session inactivity timeout is set in milliseconds while device inactivity timeout is in seconds. defaultInactivityTimeoutInSec: "${DEFAULT_INACTIVITY_TIMEOUT:600}" defaultStateCheckIntervalInSec: "${DEFAULT_STATE_CHECK_INTERVAL:60}" # Interval for checking the device state after a specified period. Time in seconds # Controls whether we store the device 'active' flag in attributes (default) or telemetry. @@ -868,11 +871,14 @@ js: # Transport configuration parameters transport: sessions: - # Parameter defines how long the device transport session will be opened after the last activity time. + # Session inactivity timeout is a global configuration parameter that defines how long the device transport session will be opened after the last message arrives from the device. + # The parameter value is in milliseconds. # The last activity time of the device session is updated if the device sends any message, including keepalive messages # If there is no activity, the session will be closed, and all subscriptions will be deleted. - # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec - # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + # We recommend this parameter to be in sync with device inactivity timeout ("state.defaultInactivityTimeoutInSec" or DEFAULT_INACTIVITY_TIMEOUT) parameter + # which is responsible for detection of the device connectivity status in the core service of the platform. + # The value of the session inactivity timeout parameter should be greater or equal to the device inactivity timeout. + # Note that the session inactivity timeout is set in milliseconds while device inactivity timeout is in seconds. inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" diff --git a/transport/coap/src/main/resources/tb-coap-transport.yml b/transport/coap/src/main/resources/tb-coap-transport.yml index a0e21134c6..faa5f43065 100644 --- a/transport/coap/src/main/resources/tb-coap-transport.yml +++ b/transport/coap/src/main/resources/tb-coap-transport.yml @@ -175,11 +175,14 @@ transport: # Interval of periodic eviction of the timed-out DTLS sessions dtls_session_report_timeout: "${TB_COAP_X509_DTLS_SESSION_REPORT_TIMEOUT:1800000}" sessions: - # Parameter defines how long the device transport session will be opened after the last activity time. + # Session inactivity timeout is a global configuration parameter that defines how long the device transport session will be opened after the last message arrives from the device. + # The parameter value is in milliseconds. # The last activity time of the device session is updated if the device sends any message, including keepalive messages # If there is no activity, the session will be closed, and all subscriptions will be deleted. - # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec - # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + # We recommend this parameter to be in sync with device inactivity timeout ("state.defaultInactivityTimeoutInSec" or DEFAULT_INACTIVITY_TIMEOUT) parameter + # which is responsible for detection of the device connectivity status in the core service of the platform. + # The value of the session inactivity timeout parameter should be greater or equal to the device inactivity timeout. + # Note that the session inactivity timeout is set in milliseconds while device inactivity timeout is in seconds. inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" diff --git a/transport/http/src/main/resources/tb-http-transport.yml b/transport/http/src/main/resources/tb-http-transport.yml index cfcf546556..49bf202200 100644 --- a/transport/http/src/main/resources/tb-http-transport.yml +++ b/transport/http/src/main/resources/tb-http-transport.yml @@ -160,11 +160,14 @@ transport: # HTTP maximum request processing timeout in milliseconds max_request_timeout: "${HTTP_MAX_REQUEST_TIMEOUT:300000}" sessions: - # Parameter defines how long the device transport session will be opened after the last activity time. + # Session inactivity timeout is a global configuration parameter that defines how long the device transport session will be opened after the last message arrives from the device. + # The parameter value is in milliseconds. # The last activity time of the device session is updated if the device sends any message, including keepalive messages # If there is no activity, the session will be closed, and all subscriptions will be deleted. - # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec - # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + # We recommend this parameter to be in sync with device inactivity timeout ("state.defaultInactivityTimeoutInSec" or DEFAULT_INACTIVITY_TIMEOUT) parameter + # which is responsible for detection of the device connectivity status in the core service of the platform. + # The value of the session inactivity timeout parameter should be greater or equal to the device inactivity timeout. + # Note that the session inactivity timeout is set in milliseconds while device inactivity timeout is in seconds. inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" diff --git a/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml b/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml index 46be8b8942..688392d264 100644 --- a/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml +++ b/transport/lwm2m/src/main/resources/tb-lwm2m-transport.yml @@ -122,11 +122,14 @@ redis: # LWM2M server parameters transport: sessions: - # Parameter defines how long the device transport session will be opened after the last activity time. + # Session inactivity timeout is a global configuration parameter that defines how long the device transport session will be opened after the last message arrives from the device. + # The parameter value is in milliseconds. # The last activity time of the device session is updated if the device sends any message, including keepalive messages # If there is no activity, the session will be closed, and all subscriptions will be deleted. - # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec - # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + # We recommend this parameter to be in sync with device inactivity timeout ("state.defaultInactivityTimeoutInSec" or DEFAULT_INACTIVITY_TIMEOUT) parameter + # which is responsible for detection of the device connectivity status in the core service of the platform. + # The value of the session inactivity timeout parameter should be greater or equal to the device inactivity timeout. + # Note that the session inactivity timeout is set in milliseconds while device inactivity timeout is in seconds. inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" diff --git a/transport/mqtt/src/main/resources/tb-mqtt-transport.yml b/transport/mqtt/src/main/resources/tb-mqtt-transport.yml index 21532952e3..55223caf4e 100644 --- a/transport/mqtt/src/main/resources/tb-mqtt-transport.yml +++ b/transport/mqtt/src/main/resources/tb-mqtt-transport.yml @@ -181,11 +181,14 @@ transport: # Skip certificate validity check for client certificates. skip_validity_check_for_client_cert: "${MQTT_SSL_SKIP_VALIDITY_CHECK_FOR_CLIENT_CERT:false}" sessions: - # Parameter defines how long the device transport session will be opened after the last activity time. + # Session inactivity timeout is a global configuration parameter that defines how long the device transport session will be opened after the last message arrives from the device. + # The parameter value is in milliseconds. # The last activity time of the device session is updated if the device sends any message, including keepalive messages # If there is no activity, the session will be closed, and all subscriptions will be deleted. - # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec - # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + # We recommend this parameter to be in sync with device inactivity timeout ("state.defaultInactivityTimeoutInSec" or DEFAULT_INACTIVITY_TIMEOUT) parameter + # which is responsible for detection of the device connectivity status in the core service of the platform. + # The value of the session inactivity timeout parameter should be greater or equal to the device inactivity timeout. + # Note that the session inactivity timeout is set in milliseconds while device inactivity timeout is in seconds. inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}" diff --git a/transport/snmp/src/main/resources/tb-snmp-transport.yml b/transport/snmp/src/main/resources/tb-snmp-transport.yml index 9858fd5c8a..805ab5a8dd 100644 --- a/transport/snmp/src/main/resources/tb-snmp-transport.yml +++ b/transport/snmp/src/main/resources/tb-snmp-transport.yml @@ -137,11 +137,14 @@ transport: # To ignore SNMP response values that do not match the data type of the configured OID mapping (by default false - will throw an error if any value of the response not match configured data types) ignore_type_cast_errors: "${SNMP_RESPONSE_IGNORE_TYPE_CAST_ERRORS:false}" sessions: - # Parameter defines how long the device transport session will be opened after the last activity time. + # Session inactivity timeout is a global configuration parameter that defines how long the device transport session will be opened after the last message arrives from the device. + # The parameter value is in milliseconds. # The last activity time of the device session is updated if the device sends any message, including keepalive messages # If there is no activity, the session will be closed, and all subscriptions will be deleted. - # We recommend this parameter to be in sync with state.defaultInactivityTimeoutInSec - # (current parameter should be equal to or greater than defaultInactivityTimeoutInSec; if not, you can get the situation when the session is closed for the active device). + # We recommend this parameter to be in sync with device inactivity timeout ("state.defaultInactivityTimeoutInSec" or DEFAULT_INACTIVITY_TIMEOUT) parameter + # which is responsible for detection of the device connectivity status in the core service of the platform. + # The value of the session inactivity timeout parameter should be greater or equal to the device inactivity timeout. + # Note that the session inactivity timeout is set in milliseconds while device inactivity timeout is in seconds. inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:600000}" # Interval of periodic check for expired sessions and report of the changes to session last activity time report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:3000}"