Skip to content

Commit

Permalink
Fix #170: In case of offsetOutOfRange, the consumer should be paused.
Browse files Browse the repository at this point in the history
  • Loading branch information
kadishmal committed Mar 6, 2015
1 parent 0738f4f commit d923143
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

## Version NEXT (Unreleased)

- Fix #169: When paused why try to fetch every 1000 ms?
- Fix #170: In case of `offsetOutOfRange`, the consumer should be paused.
- Fix #169: When paused why try to fetch every 1000 ms?
2 changes: 2 additions & 0 deletions lib/highLevelConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ HighLevelConsumer.prototype.connect = function () {
});

this.on('offsetOutOfRange', function (topic) {
self.pause();
topic.maxNum = self.options.maxNumSegments;
topic.metadata = 'm';
topic.time = Date.now();
Expand All @@ -229,6 +230,7 @@ HighLevelConsumer.prototype.connect = function () {
var min = Math.min.apply(null, offsets[topic.topic][topic.partition]);
// set minimal offset
self.setOffset(topic.topic, topic.partition, min);
self.resume();
}
});
});
Expand Down

0 comments on commit d923143

Please sign in to comment.