-
Notifications
You must be signed in to change notification settings - Fork 12k
[ISSUE-9632] Fix: Pop Long-polling Not Awakened for V1 Retry Messages #9637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
broker/src/main/java/org/apache/rocketmq/broker/longpolling/PopLongPollingService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpu cost too much when there are many groups online
Use properties inside the msg to parser the originTopic.
Thanks! I have added "PROPERTY_ORIGIN_TOPIC" as a property inside a msg. The property can be used to parser the original topic name in retryTopic msg. |
This is the pop.log printed by my code. |
if (topic.startsWith(prefix)) { | ||
// 从properties获取原始topic名称 | ||
String originTopic = properties.get(MessageConst.PROPERTY_ORIGIN_TOPIC); | ||
//根据原始topic和retryTopic,最后获得retryTopic对应的cid (可能还可以与topicCidMap验证一下) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete Chinese comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Thanks for your review.
Which Issue(s) This PR Fixes
#9632
Fixes #9632
Brief Description
a. 通过遍历topicCidMap中的所有topic-consumerGroup组合
b. 对每个组合重建V1重试Topic名称,与输入的重试Topic进行匹配
a. 在有歧义的情况下,返回原始的重试Topic名称,避免错误的消息路由,不会因为Topic命名冲突导致消息通知错误(虽然如果有冲突,错误一定会发生的,但不会因为这段代码的修改引起)
How Did You Test This Change?