consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET) no use

459 views Asked by At

I want to read data from last offset, but use:

consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET)

No effect.

1

There are 1 answers

0
Xinyu Zhou On

ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET only works when your consumer connect to broker in the first time.

You may want to use sh mqadmin resetOffsetByTime to reset the offset to now. More details please refer to here.