consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET) no use

500 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 best solutions below

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