You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "HScarb (via GitHub)" <gi...@apache.org> on 2023/05/07 15:16:52 UTC
[GitHub] [rocketmq] HScarb commented on a diff in pull request #6682: [ISSUE #6681] fix: fix pop retry message notification
HScarb commented on code in PR #6682:
URL: https://github.com/apache/rocketmq/pull/6682#discussion_r1186870849
##########
broker/src/main/java/org/apache/rocketmq/broker/processor/PopMessageProcessor.java:
##########
@@ -734,15 +767,13 @@ private int polling(final Channel channel, RemotingCommand remotingCommand,
if (requestHeader.getPollTime() <= 0 || this.popLongPollingService.isStopped()) {
return NOT_POLLING;
}
- ConcurrentHashMap<String, Byte> cids = topicCidMap.get(requestHeader.getTopic());
- if (cids == null) {
- cids = new ConcurrentHashMap<>();
- ConcurrentHashMap<String, Byte> old = topicCidMap.putIfAbsent(requestHeader.getTopic(), cids);
- if (old != null) {
- cids = old;
- }
- }
- cids.putIfAbsent(requestHeader.getConsumerGroup(), Byte.MIN_VALUE);
+ topicCidMap.computeIfAbsent(requestHeader.getTopic(), k -> new ConcurrentHashMap<>())
+ .putIfAbsent(requestHeader.getConsumerGroup(), Byte.MIN_VALUE);
+ final String popRetryTopic
+ = KeyBuilder.buildPopRetryTopic(requestHeader.getTopic(), requestHeader.getConsumerGroup());
+ topicCidMap.computeIfAbsent(popRetryTopic, k -> new ConcurrentHashMap<>())
Review Comment:
Because `notifyMessageArriving(final String toic, final int queueId)` is called by ReputMessageService, the topic won't be changed to normal topic.

--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org