Skip to content
Snippets Groups Projects
Unverified Commit 69f341a7 authored by lin's avatar lin Committed by GitHub
Browse files

optimize: Local variable 'map' is redundant and check queue offer return value (#3188)

parent 43f58903
No related branches found
No related tags found
No related merge requests found
......@@ -155,7 +155,11 @@ public abstract class AbstractNettyRemotingClient extends AbstractNettyRemoting
// put message into basketMap
BlockingQueue<RpcMessage> basket = CollectionUtils.computeIfAbsent(basketMap, serverAddress,
key -> new LinkedBlockingQueue<>());
basket.offer(rpcMessage);
if (!basket.offer(rpcMessage)) {
LOGGER.error("put message into basketMap offer failed, serverAddress:{},rpcMessage:{}",
serverAddress, rpcMessage);
return null;
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("offer message: {}", rpcMessage.getBody());
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment