Repository navigation
fix(group): allow zero retry settings on update - #4123
Merged
lizhimins merged 1 commit intoSep 9, 2026
Merged
Conversation
RockteMQ-AI
approved these changes
Sep 8, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Fixes a validation inconsistency where UpdateConsumerGroupSettingsDTO rejected retryQueueNums=0 and retryMaxTimes=0 with @positive while the create DTO accepted them with @PositiveOrZero and 0 is a legitimate broker-side value. Simple annotation change aligning update with create. LGTM.
Automated review by RockteMQ-AI
UpdateConsumerGroupSettingsDTO rejects retryQueueNums=0 and retryMaxTimes=0 with @positive, but both are valid broker-side values (0 retry queues disables them; 0 retries sends failures straight to the DLQ) and the sibling CreateConsumerGroupDTO already accepts retryMaxTimes=0 via @PositiveOrZero. A group created with retryMaxTimes=0 can therefore never re-save its settings while keeping that value - the endpoint 400s before reaching MetadataService. Align the update DTO with the create DTO. Signed-off-by: zjncs <18910855655@163.com>
lizhimins
force-pushed
the
fix/group-settings-allow-zero-retry
branch
from
September 9, 2026 12:58
3c33181 to
eb9f9be
Compare
4 tasks done
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
UpdateConsumerGroupSettingsDTOvalidates both retry fields with@Positive:But
0is a legitimate broker-side value —RocketMQAdminClientImplforwards these straight intoSubscriptionGroupConfig.setRetryQueueNums/setRetryMaxTimes, whereretryQueueNums=0disables retry queues andretryMaxTimes=0sends failed messages directly to the DLQ. The siblingCreateConsumerGroupDTOalready accepts it:Concrete failure: a group created via
POST /api/groups/createwithretryMaxTimes: 0(accepted) can never have its settings re-saved via the settings endpoint while keeping that value — the request fails bean validation with a 400 before reachingMetadataService.Modifications
Both fields switch to
@PositiveOrZerowith matching messages, aligning the update path with the create path and the broker semantics. Negative values are still rejected.Verification
New standalone
UpdateConsumerGroupSettingsDTOTest(the controller test file is under review in another PR, so the validation is pinned in its own class, modeled onAlertRuleRequestDTOTest):shouldAcceptZeroRetrySettingsTest— before the fix: fails withretryQueueNums must be positive/retryMaxTimes must be positive; after: passes.shouldRejectNegativeRetrySettingsTest— negative values still produce the two violations.mvn -f server/pom.xml test -Dtest='UpdateConsumerGroupSettingsDTOTest,ConsumerGroupControllerTest,MetadataServiceTest'→ Tests run: 59, Failures: 0, Errors: 0.