You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Allenhuangrui (via GitHub)" <gi...@apache.org> on 2025/06/16 08:56:44 UTC

[PR] Relax topic length constraint when creating retry and dlq topics [rocketmq]

Allenhuangrui opened a new pull request, #9480:
URL: https://github.com/apache/rocketmq/pull/9480

   <!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. -->
   
   Fixes #9479 
   
   ### Brief Description
   <!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
   Add two more conditions in the if statement of validateTopic method to additionally check whether the validating topic is dlq or retry topic and if it is then skip the topic length validation.
   ![image](https://github.com/user-attachments/assets/10874ffb-e304-4dba-b85c-5f4e94488532)
   
   ### How Did You Test This Change?
   
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. -->
   
   Built a snapshot of this change and tested creating dlq and retry topics of length greater than 127. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #9479] Relax topic length constraint when creating retry and dlq topics [rocketmq]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #9480:
URL: https://github.com/apache/rocketmq/pull/9480


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #9479] Relax topic length constraint when creating retry and dlq topics [rocketmq]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #9480:
URL: https://github.com/apache/rocketmq/pull/9480#issuecomment-2990322182

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/9480?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 47.98%. Comparing base [(`53a3f69`)](https://app.codecov.io/gh/apache/rocketmq/commit/53a3f699f0dd537bcbb00565d86038d28c1f0e90?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`36cacfe`)](https://app.codecov.io/gh/apache/rocketmq/commit/36cacfef96a32b739feb31c9184a6a16258658ea?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 2 commits behind head on develop.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #9480      +/-   ##
   =============================================
   - Coverage      48.15%   47.98%   -0.18%     
   + Complexity     12027    11984      -43     
   =============================================
     Files           1308     1308              
     Lines          92253    92254       +1     
     Branches       11808    11810       +2     
   =============================================
   - Hits           44425    44265     -160     
   - Misses         42343    42485     +142     
   - Partials        5485     5504      +19     
   ```
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/rocketmq/pull/9480?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Relax topic length constraint when creating retry and dlq topics [rocketmq]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #9480:
URL: https://github.com/apache/rocketmq/pull/9480#discussion_r2151222954


##########
common/src/main/java/org/apache/rocketmq/common/topic/TopicValidator.java:
##########
@@ -111,7 +112,9 @@ public static ValidateTopicResult validateTopic(String topic) {
             return new ValidateTopicResult(false, "The specified topic contains illegal characters, allowing only ^[%|a-zA-Z0-9_-]+$");
         }
 
-        if (topic.length() > TOPIC_MAX_LENGTH) {
+        if (!topic.startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX) &&
+            !topic.startsWith(MixAll.DLQ_GROUP_TOPIC_PREFIX) &&

Review Comment:
   那么 retry 和 dlq 的限制呢



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Relax topic length constraint when creating retry and dlq topics [rocketmq]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #9480:
URL: https://github.com/apache/rocketmq/pull/9480#discussion_r2151222954


##########
common/src/main/java/org/apache/rocketmq/common/topic/TopicValidator.java:
##########
@@ -111,7 +112,9 @@ public static ValidateTopicResult validateTopic(String topic) {
             return new ValidateTopicResult(false, "The specified topic contains illegal characters, allowing only ^[%|a-zA-Z0-9_-]+$");
         }
 
-        if (topic.length() > TOPIC_MAX_LENGTH) {
+        if (!topic.startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX) &&
+            !topic.startsWith(MixAll.DLQ_GROUP_TOPIC_PREFIX) &&

Review Comment:
   那么 retry 和 dlq 的限制呢



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #9479] Relax topic length constraint when creating retry and dlq topics [rocketmq]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #9480:
URL: https://github.com/apache/rocketmq/pull/9480#issuecomment-2986676067

   add some unit test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org