[ISSUE #10405] Fix orderly consumer retry message routed to wrong broker via TBW102 fallback#10408
[ISSUE #10405] Fix orderly consumer retry message routed to wrong broker via TBW102 fallback#10408qianye1001 wants to merge 2 commits into
Conversation
…ng broker via TBW102 fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #10408 +/- ##
=============================================
- Coverage 47.99% 47.92% -0.07%
+ Complexity 13271 13251 -20
=============================================
Files 1376 1376
Lines 100536 100582 +46
Branches 12983 12995 +12
=============================================
- Hits 48249 48201 -48
- Misses 46355 46439 +84
- Partials 5932 5942 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
oss-sentinel-ai
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10408 — Fix orderly consumer retry message routed to wrong broker via TBW102 fallback
Type: Bug fix (2 files, +74/-2)
Assessment
Well-documented fix for a real routing issue in orderly consumers. The root cause analysis is clear:
Problem: When orderly consumers hit maxReconsumeTimes, retry messages were routed via getDefaultMQProducer().send() which falls back to TBW102 (present on ALL brokers), causing %RETRY% topics to be auto-created on brokers that don't host the original topic.
Solution: Added trySendToTopicBroker() to both ConsumeMessageOrderlyService and ConsumeMessagePopOrderlyService:
- Prefer original broker (where message was consumed)
- Failover to other brokers hosting the topic
- Final fallback to default send (backward compatible)
Verdict
✅ Clean, focused fix with proper failover logic. Consistent with how ConsumeMessageConcurrentlyService handles this case. Fixes #10405.
🤖 Automated review by oss-sentinel-ai
Review by github-manager-botSummaryFixes orderly consumer retry message routing by sending to brokers that host the original topic instead of falling back to TBW102, which routes to all brokers. Findings
Suggestions
Automated review by github-manager-bot |
Summary
ConsumeMessageOrderlyService.sendMessageBack()andConsumeMessagePopOrderlyService.sendMessageBack()to route retry messages to brokers that actually host the original topic, instead of falling back to TBW102 which routes to all brokers in the cluster.Root Cause
When an orderly consumer's reconsume times reach
maxReconsumeTimes,sendMessageBack()sends the retry message viagetDefaultMQProducer().send(newMsg)— a normal producer send. Since the%RETRY%topic doesn't exist yet, the producer falls back to TBW102 (a system topic present on ALL brokers) for broker selection. This causes the%RETRY%topic to be auto-created on brokers that don't host the original topic.Contrast with concurrent consumers:
ConsumeMessageConcurrentlyServiceusesconsumerSendMsgBackwhich targetsmsg.getBrokerName()directly — no TBW102 fallback.Fix
Added
trySendToTopicBroker()to both orderly service classes. It uses the consumer's existingtopicSubscribeInfoTable(route info for the original topic) to select candidate brokers:Impact
No behavioral change for brokers that DO host the original topic. Backward compatible.
Test plan
trySendToTopicBrokerprefers the original broker when available%RETRY%should only appear on brokers hosting the original topicCloses #10405
🤖 Generated with Claude Code