|
|
@ -164,7 +164,7 @@ public class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcesso |
|
|
} else { |
|
|
} else { |
|
|
logger.debug("[{}] No pending RPC messages for new async session [{}]", deviceId, sessionId); |
|
|
logger.debug("[{}] No pending RPC messages for new async session [{}]", deviceId, sessionId); |
|
|
} |
|
|
} |
|
|
Set<UUID> sentOneWayIds = new HashSet<>(); |
|
|
Set<Integer> sentOneWayIds = new HashSet<>(); |
|
|
if (type == SessionType.ASYNC) { |
|
|
if (type == SessionType.ASYNC) { |
|
|
rpcPendingMap.entrySet().forEach(processPendingRpc(context, sessionId, server, sentOneWayIds)); |
|
|
rpcPendingMap.entrySet().forEach(processPendingRpc(context, sessionId, server, sentOneWayIds)); |
|
|
} else { |
|
|
} else { |
|
|
@ -174,12 +174,12 @@ public class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcesso |
|
|
sentOneWayIds.forEach(rpcPendingMap::remove); |
|
|
sentOneWayIds.forEach(rpcPendingMap::remove); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private Consumer<Map.Entry<Integer, ToDeviceRpcRequestMetadata>> processPendingRpc(ActorContext context, SessionId sessionId, Optional<ServerAddress> server, Set<UUID> sentOneWayIds) { |
|
|
private Consumer<Map.Entry<Integer, ToDeviceRpcRequestMetadata>> processPendingRpc(ActorContext context, SessionId sessionId, Optional<ServerAddress> server, Set<Integer> sentOneWayIds) { |
|
|
return entry -> { |
|
|
return entry -> { |
|
|
ToDeviceRpcRequest request = entry.getValue().getMsg().getMsg(); |
|
|
ToDeviceRpcRequest request = entry.getValue().getMsg().getMsg(); |
|
|
ToDeviceRpcRequestBody body = request.getBody(); |
|
|
ToDeviceRpcRequestBody body = request.getBody(); |
|
|
if (request.isOneway()) { |
|
|
if (request.isOneway()) { |
|
|
sentOneWayIds.add(request.getId()); |
|
|
sentOneWayIds.add(entry.getKey()); |
|
|
ToPluginRpcResponseDeviceMsg responsePluginMsg = toPluginRpcResponseMsg(entry.getValue().getMsg(), (String) null); |
|
|
ToPluginRpcResponseDeviceMsg responsePluginMsg = toPluginRpcResponseMsg(entry.getValue().getMsg(), (String) null); |
|
|
context.parent().tell(responsePluginMsg, ActorRef.noSender()); |
|
|
context.parent().tell(responsePluginMsg, ActorRef.noSender()); |
|
|
} |
|
|
} |
|
|
|