|
|
|
@ -15,7 +15,6 @@ |
|
|
|
*/ |
|
|
|
package org.thingsboard.server.service.edge.rpc.processor.device; |
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode; |
|
|
|
import com.google.common.util.concurrent.Futures; |
|
|
|
import com.google.common.util.concurrent.ListenableFuture; |
|
|
|
@ -40,7 +39,6 @@ import org.thingsboard.server.common.data.id.TenantId; |
|
|
|
import org.thingsboard.server.common.data.msg.TbMsgType; |
|
|
|
import org.thingsboard.server.common.data.rpc.RpcError; |
|
|
|
import org.thingsboard.server.common.data.security.DeviceCredentials; |
|
|
|
import org.thingsboard.server.common.data.security.DeviceCredentialsType; |
|
|
|
import org.thingsboard.server.common.msg.TbMsg; |
|
|
|
import org.thingsboard.server.common.msg.TbMsgDataType; |
|
|
|
import org.thingsboard.server.common.msg.TbMsgMetaData; |
|
|
|
@ -196,7 +194,7 @@ public class DeviceEdgeProcessor extends BaseDeviceProcessor { |
|
|
|
data.put("method", deviceRpcCallMsg.getRequestMsg().getMethod()); |
|
|
|
data.put("params", deviceRpcCallMsg.getRequestMsg().getParams()); |
|
|
|
TbMsg tbMsg = TbMsg.newMsg(TbMsgType.TO_SERVER_RPC_REQUEST, deviceId, null, metaData, |
|
|
|
TbMsgDataType.JSON, JacksonUtil.OBJECT_MAPPER.writeValueAsString(data)); |
|
|
|
TbMsgDataType.JSON, JacksonUtil.toString(data)); |
|
|
|
tbClusterService.pushMsgToRuleEngine(tenantId, deviceId, tbMsg, new TbQueueCallback() { |
|
|
|
@Override |
|
|
|
public void onSuccess(TbQueueMsgMetadata metadata) { |
|
|
|
@ -210,7 +208,7 @@ public class DeviceEdgeProcessor extends BaseDeviceProcessor { |
|
|
|
tenantId, device, deviceRpcCallMsg, t); |
|
|
|
} |
|
|
|
}); |
|
|
|
} catch (JsonProcessingException | IllegalArgumentException e) { |
|
|
|
} catch (IllegalArgumentException e) { |
|
|
|
log.warn("[{}][{}] Failed to push TO_SERVER_RPC_REQUEST to rule engine. deviceRpcCallMsg {}", tenantId, deviceId, deviceRpcCallMsg, e); |
|
|
|
} |
|
|
|
|
|
|
|
|