Browse Source

Handle case when device was removed from db but message in the queue (#4092)

* Remove device from cache in case null value cached in the distributed redis

* Handle case when device was removed from db but message in the queue exists

* Code review chagnes
pull/4104/head
VoBa 6 years ago
committed by GitHub
parent
commit
eaa2c5785f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/TbDeviceProfileNode.java

3
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/TbDeviceProfileNode.java

@ -134,7 +134,8 @@ public class TbDeviceProfileNode implements TbNode {
if (deviceState != null) {
deviceState.process(ctx, msg);
} else {
ctx.tellFailure(msg, new IllegalStateException("Device profile for device [" + deviceId + "] not found!"));
log.info("Device was not found! Most probably device [" + deviceId + "] has been removed from the database. Acknowledging msg.");
ctx.ack(msg);
}
}
} else {

Loading…
Cancel
Save