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

   ## What is the purpose of the change
   
   Support consume-from-timestamp for pop mode consumers. Fixes #11637.
   
   In pop mode `RebalancePushImpl.getConsumeInitMode` mapped 
`CONSUME_FROM_TIMESTAMP` to `ConsumeInitMode.MAX`, so the timestamp intent was 
lost and a new group on an aged queue started from `maxOffset - 1` instead of 
the requested timestamp.
   
   ## Brief changelog
   
   - Add `ConsumeInitMode.TIMESTAMP` and an optional `timestamp` field to 
`PopMessageRequestHeader` (required when `initMode = TIMESTAMP`, enforced in 
`checkFields`).
   - `PopMessageProcessor.getInitOffset` resolves the initial offset per 
physical queue via `getOffsetInQueueByTime(..., BoundaryType.LOWER)` when the 
group has no committed offset, covering `queueId = -1` pops spanning multiple 
queues. The new-queue zero-check and committed-offset precedence are preserved, 
matching the pull path.
   - Client pop path maps `CONSUME_FROM_TIMESTAMP` to `TIMESTAMP` and carries 
the parsed timestamp through `PopRequest` / `PullAPIWrapper`.
   
   Old clients are unaffected (the field is omitted when null); a new client 
talking to an old broker degrades to MAX.
   
   ## Verifying this change
   
   New unit tests in `PopMessageProcessorTest`, `RebalancePushImplTest`, 
`DefaultMQPushConsumerImplTest` and `PullAPIWrapperTest`.
   
   ## Does this pull request potentially affect one of the following parts
   
   - Dependencies (does it add or upgrade a dependency): no
   - The public API: yes (new optional `PopMessageRequestHeader.timestamp`, new 
`ConsumeInitMode.TIMESTAMP`)
   - The schema: no
   - The default values of configurations: no
   - The wire protocol: yes (new optional header field, omitted when null)
   - The rest endpoints: no
   - The admin cli behaviors: no
   - The run time of this project: no


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