When i create consumer using a new consumer group with 'CONSUME_FROM_LAST_OFFSET'
model and subscribe a topic that has been created and has contained messages ,it will
consumer all exit messages rather than begin from last offset.
I have found this problem is here .RebalancePushImpl.java -- > computePullFromWhere
case CONSUME_FROM_LAST_OFFSET
when user new consumer group the result will be 0 rather than last offset or max offset ,
because broker will allways not do return -1 .
so it will be modified with such way
if (lastOffset > 0) {
result = lastOffset;
}
// First start,no offset
else if (0 == lastOffset) {
...