-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Refactored duplicate code in TopicPublishInfo #9257
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #9257 +/- ##
=============================================
- Coverage 48.05% 48.04% -0.01%
- Complexity 12097 12100 +3
=============================================
Files 1322 1322
Lines 93127 93133 +6
Branches 11940 11941 +1
=============================================
- Hits 44752 44747 -5
- Misses 42831 42843 +12
+ Partials 5544 5543 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
} | ||
|
||
// Adding additional logic, filter by broker name | ||
public MessageQueue selectOneMessageQueueWithCondition(String lastBrokerName) { |
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.
When is this code called?
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.
The method selectOneMessageQueue(String lastBrokerName) is called when selecting a message queue while avoiding the last used broker. It ensures that messages are not sent repeatedly to the same broker when possible, improving load balancing and fault tolerance.
If all available queues belong to the same broker, it falls back to selecting any queue
Hi @RongtongJin, |
Refactored TopicPublishInfo to remove duplicate code
getMessageQueue
.selectOneMessageQueue
to use the new method.Resolves #6398