Browse Source

Fix for TbMsg serialization error: '...TbMsgCallback cannot be serialized...'

pull/3293/head
Igor Kulikov 6 years ago
parent
commit
30b0897e87
  1. 2
      common/message/src/main/java/org/thingsboard/server/common/msg/TbMsg.java

2
common/message/src/main/java/org/thingsboard/server/common/msg/TbMsg.java

@ -15,6 +15,7 @@
*/ */
package org.thingsboard.server.common.msg; package org.thingsboard.server.common.msg;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import lombok.Builder; import lombok.Builder;
@ -51,6 +52,7 @@ public final class TbMsg implements Serializable {
private final RuleChainId ruleChainId; private final RuleChainId ruleChainId;
private final RuleNodeId ruleNodeId; private final RuleNodeId ruleNodeId;
//This field is not serialized because we use queues and there is no need to do it //This field is not serialized because we use queues and there is no need to do it
@JsonIgnore
transient private final TbMsgCallback callback; transient private final TbMsgCallback callback;
public static TbMsg newMsg(String queueName, String type, EntityId originator, TbMsgMetaData metaData, String data, RuleChainId ruleChainId, RuleNodeId ruleNodeId) { public static TbMsg newMsg(String queueName, String type, EntityId originator, TbMsgMetaData metaData, String data, RuleChainId ruleChainId, RuleNodeId ruleNodeId) {

Loading…
Cancel
Save