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
This commit is contained in:
VoBa 2021-02-12 16:06:01 +02:00 committed by GitHub
parent dac7c5250f
commit eaa2c5785f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,7 +134,8 @@ public class TbDeviceProfileNode implements TbNode {
if (deviceState != null) { if (deviceState != null) {
deviceState.process(ctx, msg); deviceState.process(ctx, msg);
} else { } 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 { } else {