Skip to content

Commit

Permalink
Fixes #569 producer recover from broker going down
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperlink committed Jan 31, 2017
1 parent 74d3d2a commit 925d477
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/baseProducer.js
Expand Up @@ -83,7 +83,12 @@ BaseProducer.prototype.connect = function () {
}
});
this.client.on('brokersChanged', function () {
this.topicMetadata = {};
let topics = Object.keys(this.topicMetadata);
this.refreshMetadata(topics, function (error) {
if (error) {
self.emit(error);
}
});
});
this.client.on('error', function (err) {
self.emit('error', err);
Expand Down

0 comments on commit 925d477

Please sign in to comment.