Refactored duplicate code in TopicPublishInfo#9257
Refactored duplicate code in TopicPublishInfo#9257DivyanshIITB wants to merge 2 commits intoapache:developfrom
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.
When is this code called?
There was a problem hiding this comment.
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.selectOneMessageQueueto use the new method.Resolves #6398