Commit 4c0812898cb1a07c87bac73bf6ce3b7fe2f92aec
1 parent
b31f0748
Skip Notification To Transport without ServiceId
Showing
2 changed files
with
8 additions
and
0 deletions
... | ... | @@ -196,6 +196,10 @@ public class DefaultTbClusterService implements TbClusterService { |
196 | 196 | |
197 | 197 | @Override |
198 | 198 | public void pushNotificationToTransport(String serviceId, ToTransportMsg response, TbQueueCallback callback) { |
199 | + if (serviceId == null || serviceId.isEmpty()){ | |
200 | + log.trace("pushNotificationToTransport: skipping message without serviceId [{}], (ToTransportMsg) response [{}]", serviceId, response); | |
201 | + return; | |
202 | + } | |
199 | 203 | TopicPartitionInfo tpi = partitionService.getNotificationsTopic(ServiceType.TB_TRANSPORT, serviceId); |
200 | 204 | log.trace("PUSHING msg: {} to:{}", response, tpi); |
201 | 205 | producerProvider.getTransportNotificationsMsgProducer().send(tpi, new TbProtoQueueMsg<>(UUID.randomUUID(), response), callback); | ... | ... |
... | ... | @@ -87,6 +87,10 @@ public class DefaultTbRuleEngineRpcService implements TbRuleEngineDeviceRpcServi |
87 | 87 | |
88 | 88 | @Override |
89 | 89 | public void sendRpcReplyToDevice(String serviceId, UUID sessionId, int requestId, String body) { |
90 | + if (serviceId == null || serviceId.isEmpty()){ | |
91 | + log.trace("sendRpcReplyToDevice: skipping message without serviceId [{}], sessionId[{}], requestId[{}], body[{}]", serviceId, sessionId, requestId, body); | |
92 | + return; | |
93 | + } | |
90 | 94 | TransportProtos.ToServerRpcResponseMsg responseMsg = TransportProtos.ToServerRpcResponseMsg.newBuilder() |
91 | 95 | .setRequestId(requestId) |
92 | 96 | .setPayload(body).build(); | ... | ... |