odbozhou commented on a change in pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499#discussion_r751955059
##########
File path:
broker/src/main/java/org/apache/rocketmq/broker/processor/PopMessageProcessor.java
##########
@@ -350,7 +353,7 @@ private RemotingCommand processRequest(final Channel
channel, RemotingCommand re
if (requestHeader.isOrder()) {
reviveQid = KeyBuilder.POP_ORDER_REVIVE_QUEUE;
} else {
- reviveQid = randomQ %
this.brokerController.getBrokerConfig().getReviveQueueNum();
+ reviveQid = Math.abs(ckMessageNumber.getAndIncrement() %
this.brokerController.getBrokerConfig().getReviveQueueNum());
Review comment:
Whether the range of AtomicInteger is a bit small, even if there is abs,
it may return a negative number, and the message volume may be out of bounds if
it is too large. Is AtomicLong or ThreadLocalRandom better?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]