[ISSUE #10793] Handle offline consumer list queries - #10794
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Aligns GET_CONSUMER_LIST_BY_GROUP behavior with GET_CONSUMER_CONNECTION_LIST by returning CONSUMER_NOT_ONLINE when a consumer group has no online info, and adds a regression test for that offline-group path.
Changes:
- Return
ResponseCode.CONSUMER_NOT_ONLINEearly whengetConsumerGroupInfo(...)returnsnull - Add a JUnit test covering the offline/missing-group scenario
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| proxy/src/main/java/org/apache/rocketmq/proxy/remoting/activity/ConsumerManagerActivity.java | Adds early return with CONSUMER_NOT_ONLINE when group info is missing |
| proxy/src/test/java/org/apache/rocketmq/proxy/remoting/activity/ConsumerManagerActivityTest.java | Adds regression test for the offline-group response code/remark |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assertThat(response.getCode()).isEqualTo(ResponseCode.CONSUMER_NOT_ONLINE); | ||
| assertThat(response.getRemark()).isEqualTo("the consumer group[offline-group] not online"); |
| if (consumerGroupInfo == null) { | ||
| response.setCode(ResponseCode.CONSUMER_NOT_ONLINE); | ||
| response.setRemark("the consumer group[" + header.getConsumerGroup() + "] not online"); | ||
| return response; | ||
| } |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10794 +/- ##
=============================================
- Coverage 48.34% 48.24% -0.10%
+ Complexity 13527 13498 -29
=============================================
Files 1380 1380
Lines 101104 101143 +39
Branches 13107 13121 +14
=============================================
- Hits 48882 48800 -82
- Misses 46267 46355 +88
- Partials 5955 5988 +33 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
GET_CONSUMER_LIST_BY_GROUPreturnCONSUMER_NOT_ONLINEwhen the requested group has no online consumer infoGET_CONSUMER_CONNECTION_LISTin the same activityTests
mvn -pl proxy -Dtest=ConsumerManagerActivityTest testCloses #10793