diff --git a/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java b/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java index 3574e83d7d..86afdb488d 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java +++ b/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java @@ -384,7 +384,7 @@ public class BaseRelationService implements RelationService { Set children = new HashSet<>(findRelations(rootId, direction).get()); Set childrenIds = new HashSet<>(); for (EntityRelation childRelation : children) { - log.info("Found Relation: {}", childRelation); + log.trace("Found Relation: {}", childRelation); EntityId childId; if (direction == EntitySearchDirection.FROM) { childId = childRelation.getTo(); @@ -392,9 +392,9 @@ public class BaseRelationService implements RelationService { childId = childRelation.getFrom(); } if (uniqueMap.putIfAbsent(childId, Boolean.TRUE) == null) { - log.info("Adding Relation: {}", childId); + log.trace("Adding Relation: {}", childId); if (childrenIds.add(childId)) { - log.info("Added Relation: {}", childId); + log.trace("Added Relation: {}", childId); } } } diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java index 2e6abfde96..7e4c2eac9c 100644 --- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java +++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java @@ -229,6 +229,8 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement } else if (topicName.equals(DEVICE_ATTRIBUTES_RESPONSES_TOPIC)) { deviceSessionCtx.setAllowAttributeResponses(); grantedQoSList.add(getMinSupportedQos(reqQoS)); + } else if (topicName.equals(GATEWAY_ATTRIBUTES_TOPIC)) { + grantedQoSList.add(getMinSupportedQos(reqQoS)); } else { log.warn("[{}] Failed to subscribe to [{}][{}]", sessionId, topicName, reqQoS); grantedQoSList.add(FAILURE.value()); diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java index 5bccf49663..d69341c999 100644 --- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java +++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java @@ -183,8 +183,8 @@ public class GatewaySessionCtx { } } - public void onDeviceAttributesRequest(MqttPublishMessage mqttMsg) throws AdaptorException { - JsonElement json = validateJsonPayload(gatewaySessionId, mqttMsg.payload()); + public void onDeviceAttributesRequest(MqttPublishMessage msg) throws AdaptorException { + JsonElement json = validateJsonPayload(gatewaySessionId, msg.payload()); if (json.isJsonObject()) { JsonObject jsonObj = json.getAsJsonObject(); int requestId = jsonObj.get("id").getAsInt(); @@ -210,6 +210,7 @@ public class GatewaySessionCtx { GatewayDeviceSessionCtx deviceSessionCtx = devices.get(deviceName); processor.process(new BasicToDeviceActorSessionMsg(deviceSessionCtx.getDevice(), new BasicAdaptorToSessionActorMsg(deviceSessionCtx, request))); + ack(msg); } else { throw new JsonSyntaxException(CAN_T_PARSE_VALUE + json); }