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

   ### Which Issue(s) This PR Fixes
   
   Fixes #11415
   
   ### Brief Description
   
   Remove the extra subtraction when accounting for each queue's offset range 
in `mqadmin consumeMessage`. Previously, `-c 2` printed only one message when 
two queues each contained one message, and an empty queue could exhaust the 
remaining limit.
   
   Add deterministic command-level tests using a mocked pull consumer and an 
ordered queue set. They cover an empty first queue, an empty queue between 
populated queues, a limit spanning queues, a limit reached within the next 
queue, and stopping at the requested limit. Each new test uses an isolated 
command and consumer.
   
   ### How Did You Test This Change?
   
   - Confirmed the multi-queue regression fails before the production fix: 2 
expected messages versus 1 actual message.
   - `ConsumeMessageCommandTest`: 9 tests passed, with no failures, errors, or 
skipped tests.
   - Maven compile with Checkstyle and SpotBugs passed for the tools reactor.
   - `git diff --check` passed.
   
   Local commands:
   
   ```text
   mvn -o -B -pl tools -am -Dtest=ConsumeMessageCommandTest 
-Dsurefire.failIfNoSpecifiedTests=false -Dspotbugs.skip=true -Djacoco.skip=true 
test
   mvn -o -B -pl tools -am -DskipTests -Djacoco.skip=true compile
   ```
   
   Validated on Windows 11 with JDK 17.0.19 and Maven 3.9.16. Tests use a 
mocked pull consumer and do not require a running cluster. JaCoCo coverage and 
the full repository test suite were not run locally.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to