-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
Milestone
Description
BUG REPORT
- Please describe the issue you observed:
-
What did you do (The steps to reproduce)?
Restart the broker when consumer is running -
What did you expect to see?
The consumer continues to consume from the last offset -
What did you see instead?
It consumed from 0
-
Please tell us about your environment:
Linux -
Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
2021-11-17 20:16:12 WARN PullMessageThread_21 - Pop initial offset, because store is no correct, pop-1@consumer@3, 5384577->null
2021-11-17 20:16:12 WARN PullMessageThread_69 - Pop initial offset, because store is no correct, pop-1@consumer@2, 5384587->null
2021-11-17 20:16:12 WARN PullMessageThread_3 - Pop initial offset, because store is no correct, pop-1@consumer@0, 26128469->null
2021-11-17 20:16:12 WARN PullMessageThread_31 - Pop initial offset, because store is no correct, pop-1@consumer@1, 12384558->null
2021-11-17 20:16:12 WARN PullMessageThread_78 - Pop initial offset, because store is no correct, %RETRY%consumer_pop-1@consumer@0, 143690->null
getMessage()
will return null when:
public GetMessageResult getMessage(final String group, final String topic, final int queueId, final long offset,
final int maxMsgNums,
final MessageFilter messageFilter) {
if (this.shutdown) {
log.warn("message store has shutdown, so getMessage is forbidden");
return null;
}
if (!this.runningFlags.isReadable()) {
log.warn("message store is not readable, so getMessage is forbidden " + this.runningFlags.getFlagBits());
return null;
}
...
I think that the offset should not be set as 0 when this method return null.
public GetMessageResult getMessage(final String group, final String topic, final int queueId, final long offset, |