chennaji9 opened a new pull request, #11294: URL: https://github.com/apache/rocketmq/pull/11294
<!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. --> ### Which Issue(s) This PR Fixes Fixes #11282 ### Brief Description The lite-pull assign example built its assign list with floor division (`list.size() / 2`), so a topic with a **single** message queue produced an empty assign list and the following `assignList.get(0)` threw `IndexOutOfBoundsException`. Uses ceiling division `(list.size() + 1) / 2` instead, so at least one queue is assigned whenever the topic has queues (1→1, 2→1, 3→2, 4→2). One-line change, nothing else in the file touched. ### How Did You Test This Change? - `mvn -B -pl example -am -DskipTests -Dmaven.javadoc.skip=true compile` → BUILD SUCCESS (exit 0). - Arithmetic check of both formulas for queue counts 0..5: old `n/2` assigns 0 queues for n=1 (crash at `get(0)`), new `(n+1)/2` assigns 1; n=3 goes from 1 to 2, matching the example's "about half" intent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
