|
@@ -867,7 +867,7 @@ public final class EdgeGrpcSession implements Closeable { |
|
@@ -867,7 +867,7 @@ public final class EdgeGrpcSession implements Closeable { |
867
|
}
|
867
|
}
|
868
|
if (uplinkMsg.getRelationUpdateMsgList() != null && !uplinkMsg.getRelationUpdateMsgList().isEmpty()) {
|
868
|
if (uplinkMsg.getRelationUpdateMsgList() != null && !uplinkMsg.getRelationUpdateMsgList().isEmpty()) {
|
869
|
for (RelationUpdateMsg relationUpdateMsg: uplinkMsg.getRelationUpdateMsgList()) {
|
869
|
for (RelationUpdateMsg relationUpdateMsg: uplinkMsg.getRelationUpdateMsgList()) {
|
870
|
- onRelationUpdate(relationUpdateMsg);
|
870
|
+ result.add(onRelationUpdate(relationUpdateMsg));
|
871
|
}
|
871
|
}
|
872
|
}
|
872
|
}
|
873
|
if (uplinkMsg.getRuleChainMetadataRequestMsgList() != null && !uplinkMsg.getRuleChainMetadataRequestMsgList().isEmpty()) {
|
873
|
if (uplinkMsg.getRuleChainMetadataRequestMsgList() != null && !uplinkMsg.getRuleChainMetadataRequestMsgList().isEmpty()) {
|
|
@@ -1170,11 +1170,13 @@ public final class EdgeGrpcSession implements Closeable { |
|
@@ -1170,11 +1170,13 @@ public final class EdgeGrpcSession implements Closeable { |
1170
|
@Override
|
1170
|
@Override
|
1171
|
public void onSuccess(TbQueueMsgMetadata metadata) {
|
1171
|
public void onSuccess(TbQueueMsgMetadata metadata) {
|
1172
|
// TODO: voba - handle success
|
1172
|
// TODO: voba - handle success
|
|
|
1173
|
+ log.debug("Successfully send ENTITY_CREATED EVENT to rule engine [{}]", device);
|
1173
|
}
|
1174
|
}
|
1174
|
|
1175
|
|
1175
|
@Override
|
1176
|
@Override
|
1176
|
public void onFailure(Throwable t) {
|
1177
|
public void onFailure(Throwable t) {
|
1177
|
// TODO: voba - handle failure
|
1178
|
// TODO: voba - handle failure
|
|
|
1179
|
+ log.debug("Failed to send ENTITY_CREATED EVENT to rule engine [{}]", device, t);
|
1178
|
}
|
1180
|
}
|
1179
|
});
|
1181
|
});
|
1180
|
} catch (JsonProcessingException | IllegalArgumentException e) {
|
1182
|
} catch (JsonProcessingException | IllegalArgumentException e) {
|
|
@@ -1262,12 +1264,12 @@ public final class EdgeGrpcSession implements Closeable { |
|
@@ -1262,12 +1264,12 @@ public final class EdgeGrpcSession implements Closeable { |
1262
|
}
|
1264
|
}
|
1263
|
return Futures.immediateFuture(null);
|
1265
|
return Futures.immediateFuture(null);
|
1264
|
} catch (Exception e) {
|
1266
|
} catch (Exception e) {
|
1265
|
- log.error("Error during finding existent alarm", e);
|
|
|
1266
|
- return Futures.immediateFailedFuture(new RuntimeException("Error during finding existent alarm", e));
|
1267
|
+ log.error("Failed to process alarm update msg [{}]", alarmUpdateMsg, e);
|
|
|
1268
|
+ return Futures.immediateFailedFuture(new RuntimeException("Failed to process alarm update msg", e));
|
1267
|
}
|
1269
|
}
|
1268
|
}
|
1270
|
}
|
1269
|
|
1271
|
|
1270
|
- private void onRelationUpdate(RelationUpdateMsg relationUpdateMsg) {
|
1272
|
+ private ListenableFuture<Void> onRelationUpdate(RelationUpdateMsg relationUpdateMsg) {
|
1271
|
log.info("onRelationUpdate {}", relationUpdateMsg);
|
1273
|
log.info("onRelationUpdate {}", relationUpdateMsg);
|
1272
|
try {
|
1274
|
try {
|
1273
|
EntityRelation entityRelation = new EntityRelation();
|
1275
|
EntityRelation entityRelation = new EntityRelation();
|
|
@@ -1297,8 +1299,10 @@ public final class EdgeGrpcSession implements Closeable { |
|
@@ -1297,8 +1299,10 @@ public final class EdgeGrpcSession implements Closeable { |
1297
|
case UNRECOGNIZED:
|
1299
|
case UNRECOGNIZED:
|
1298
|
log.error("Unsupported msg type");
|
1300
|
log.error("Unsupported msg type");
|
1299
|
}
|
1301
|
}
|
|
|
1302
|
+ return Futures.immediateFuture(null);
|
1300
|
} catch (Exception e) {
|
1303
|
} catch (Exception e) {
|
1301
|
- log.error("Error during relation update msg", e);
|
1304
|
+ log.error("Failed to process relation update msg [{}]", relationUpdateMsg, e);
|
|
|
1305
|
+ return Futures.immediateFailedFuture(new RuntimeException("Failed to process relation update msg", e));
|
1302
|
}
|
1306
|
}
|
1303
|
}
|
1307
|
}
|
1304
|
|
1308
|
|