diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index cb7beb6350..da2b7b10db 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -406,6 +406,9 @@ transport: enabled: "${TB_TRANSPORT_RATE_LIMITS_ENABLED:false}" tenant: "${TB_TRANSPORT_RATE_LIMITS_TENANT:1000:1,20000:60}" device: "${TB_TRANSPORT_RATE_LIMITS_DEVICE:10:1,300:60}" + json: + # Cast String data types to Numeric if possible when processing Telemetry/Attributes JSON + type_cast_enabled: "${JSON_TYPE_CAST_ENABLED:true}" # Local HTTP transport parameters http: enabled: "${HTTP_ENABLED:true}" @@ -443,7 +446,3 @@ transport: bind_address: "${COAP_BIND_ADDRESS:0.0.0.0}" bind_port: "${COAP_BIND_PORT:5683}" timeout: "${COAP_TIMEOUT:10000}" - -json: - # Cast String data types to Numeric if possible when processing Telemetry/Attributes JSON - type_cast_enabled: "${JSON_TYPE_CAST_ENABLED:false}" \ No newline at end of file diff --git a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/adaptor/JsonConverterConfig.java b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/adaptor/JsonConverterConfig.java index cc41fe0eca..ac3f4dc580 100644 --- a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/adaptor/JsonConverterConfig.java +++ b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/adaptor/JsonConverterConfig.java @@ -23,7 +23,7 @@ import org.springframework.context.annotation.Configuration; @Slf4j public class JsonConverterConfig { - @Value("${json.type_cast_enabled}") + @Value("${transport.json.type_cast_enabled:true}") public void setIsJsonTypeCastEnabled(boolean jsonTypeCastEnabled) { JsonConverter.setTypeCastEnabled(jsonTypeCastEnabled); log.info("JSON type cast enabled = {}", jsonTypeCastEnabled); diff --git a/transport/coap/src/main/resources/tb-coap-transport.yml b/transport/coap/src/main/resources/tb-coap-transport.yml index d20bc79ea4..95e7b7571b 100644 --- a/transport/coap/src/main/resources/tb-coap-transport.yml +++ b/transport/coap/src/main/resources/tb-coap-transport.yml @@ -30,6 +30,9 @@ transport: enabled: "${TB_TRANSPORT_RATE_LIMITS_ENABLED:false}" tenant: "${TB_TRANSPORT_RATE_LIMITS_TENANT:1000:1,20000:60}" device: "${TB_TRANSPORT_RATE_LIMITS_DEVICE:10:1,300:60}" + json: + # Cast String data types to Numeric if possible when processing Telemetry/Attributes JSON + type_cast_enabled: "${JSON_TYPE_CAST_ENABLED:true}" kafka: enabled: true @@ -52,7 +55,3 @@ kafka: topic: "${TB_TRANSPORT_NOTIFICATIONS_TOPIC:tb.transport.notifications}" poll_interval: "${TB_TRANSPORT_NOTIFICATIONS_POLL_INTERVAL_MS:25}" auto_commit_interval: "${TB_TRANSPORT_NOTIFICATIONS_AUTO_COMMIT_INTERVAL_MS:100}" - -json: - # Cast String data types to Numeric if possible when processing Telemetry/Attributes JSON - type_cast_enabled: "${JSON_TYPE_CAST_ENABLED:true}" \ No newline at end of file diff --git a/transport/http/src/main/resources/tb-http-transport.yml b/transport/http/src/main/resources/tb-http-transport.yml index f5f7855db7..bb1d3c4888 100644 --- a/transport/http/src/main/resources/tb-http-transport.yml +++ b/transport/http/src/main/resources/tb-http-transport.yml @@ -31,6 +31,9 @@ transport: enabled: "${TB_TRANSPORT_RATE_LIMITS_ENABLED:false}" tenant: "${TB_TRANSPORT_RATE_LIMITS_TENANT:1000:1,20000:60}" device: "${TB_TRANSPORT_RATE_LIMITS_DEVICE:10:1,300:60}" + json: + # Cast String data types to Numeric if possible when processing Telemetry/Attributes JSON + type_cast_enabled: "${JSON_TYPE_CAST_ENABLED:true}" kafka: enabled: true @@ -53,7 +56,3 @@ kafka: topic: "${TB_TRANSPORT_NOTIFICATIONS_TOPIC:tb.transport.notifications}" poll_interval: "${TB_TRANSPORT_NOTIFICATIONS_POLL_INTERVAL_MS:25}" auto_commit_interval: "${TB_TRANSPORT_NOTIFICATIONS_AUTO_COMMIT_INTERVAL_MS:100}" - -json: - # Cast String data types to Numeric if possible when processing Telemetry/Attributes JSON - type_cast_enabled: "${JSON_TYPE_CAST_ENABLED:true}" \ No newline at end of file diff --git a/transport/mqtt/src/main/resources/tb-mqtt-transport.yml b/transport/mqtt/src/main/resources/tb-mqtt-transport.yml index af1b6f01ac..719530c73f 100644 --- a/transport/mqtt/src/main/resources/tb-mqtt-transport.yml +++ b/transport/mqtt/src/main/resources/tb-mqtt-transport.yml @@ -50,6 +50,9 @@ transport: enabled: "${TB_TRANSPORT_RATE_LIMITS_ENABLED:false}" tenant: "${TB_TRANSPORT_RATE_LIMITS_TENANT:1000:1,20000:60}" device: "${TB_TRANSPORT_RATE_LIMITS_DEVICE:10:1,300:60}" + json: + # Cast String data types to Numeric if possible when processing Telemetry/Attributes JSON + type_cast_enabled: "${JSON_TYPE_CAST_ENABLED:true}" kafka: enabled: true @@ -72,7 +75,3 @@ kafka: topic: "${TB_TRANSPORT_NOTIFICATIONS_TOPIC:tb.transport.notifications}" poll_interval: "${TB_TRANSPORT_NOTIFICATIONS_POLL_INTERVAL_MS:25}" auto_commit_interval: "${TB_TRANSPORT_NOTIFICATIONS_AUTO_COMMIT_INTERVAL_MS:100}" - -json: - # Cast String data types to Numeric if possible when processing Telemetry/Attributes JSON - type_cast_enabled: "${JSON_TYPE_CAST_ENABLED:true}" \ No newline at end of file