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

   ### Motivation
   
   `receiveMessage` feeds `settings.getBackoffPolicy().getMaxAttempts()` into 
`PopMessageResultFilterImpl`. When a client leaves the backoff policy unset, 
proto3 defaults `maxAttempts` to 0, and while the subscription group config is 
unavailable (`mergeSubscriptionData` passes the raw client settings through on 
a config miss) every popped message — including its first delivery — hit 
`reconsumeTimes >= maxAttempts` and was routed straight to the DLQ.
   
   ### Modifications
   
   Clamp `maxAttempts` to at least 1 in the filter, so a message always gets 
one delivery attempt before the DLQ verdict.
   
   ### Verification
   
   Fail-before (new test, run against the unpatched code):
   
   ```
   PopMessageResultFilterImplTest#testZeroMaxAttemptsStillDeliversFirstAttempt
   java.lang.AssertionError: expected:<MATCH> but was:<TO_DLQ>
     
PopMessageResultFilterImplTest.testZeroMaxAttemptsStillDeliversFirstAttempt:47
   ```
   
   Pass-after:
   
   ```
   Tests run: 4, Failures: 0, Errors: 0, Skipped: 0 -- 
PopMessageResultFilterImplTest
   ```
   


-- 
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