Commit 3783ba67a4d613cca909b5a49c563008a94db8b3

Authored by steve
Committed by Andrew Shvayka
1 parent 99ccb831

Fix for Defect #394

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