apache / rocketmq-client-go

Apache RocketMQ go client
https://rocketmq.apache.org/
Apache License 2.0
1.3k stars 416 forks source link

Offset - ConsumeFromWhere does not take effect #937

Closed jackedelic closed 1 year ago

jackedelic commented 1 year ago

BUG REPORT

  1. Please describe the issue you observed: We initialize a consumer by specifying ConsumeFromWhere to specify where in the partition to consumer the message from.

We specify consumer.ConsumeFromLastOffset option when initializing a new PushConsumer. We expect the consumer to not consume messages produced before this point in time.

However, old messages are still being consumed instead of starting from the last offset.

  1. Please tell us about your environment:

    • What is your OS? x86_64 GNU/Linux

    • What is your client version? github.com/apache/rocketmq-client-go/v2 v2.1.1

    • What is your RocketMQ version?

I appreciate if any person with the relevant knowledge could advise us on the status so my team has a concrete plan on our end. To be more specific, we use this rocketmq client sdk to develop rocketmq consumer feature for our customers, and we would like to explicitly inform our customers whether we support ConsumeFromLastOffset option or not. Thanks again for any inputs.

ShannonDing commented 1 year ago

This parameter takes effect only for the first-time CounsumerGroup. If the current Consumer Group has been used and then restarted, the configuration of this parameter will not take effect, by default, consumers will continue to consume from the last saved offset. for some case, if you need to discard historical data and start consumption from the latest offset, you can use a new Consumer Group or reset the offset by admin tools to move the consumption offset to the latest time.

Admin tools: https://rocketmq.apache.org/zh/docs/4.x/%e9%83%a8%e7%bd%b2%e4%b8%8e%e8%bf%90%e7%bb%b4/16admintool/

jackedelic commented 1 year ago

I see. Noted with thanks. I appreciate your inputs.