Skip to content

Commit

Permalink
Merge branch 'bugfix/ZENKO-480-fix-lifecycle-consumer-hang' into q/8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-e committed Jun 12, 2018
2 parents 6eb174d + 3c890f5 commit b475039
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion extensions/lifecycle/lifecycleConsumer/LifecycleConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class LifecycleConsumer extends EventEmitter {
* @return {undefined}
*/
start() {
let consumerReady = false;
this._consumer = new BackbeatConsumer({
zookeeper: {
connectionString: this.zkConfig.connectionString,
Expand All @@ -77,8 +78,14 @@ class LifecycleConsumer extends EventEmitter {
autoCommit: true,
backlogMetrics: this.lcConfig.backlogMetrics,
});
this._consumer.on('error', () => {});
this._consumer.on('error', () => {
if (!consumerReady) {
this.logger.fatal('error starting lifecycle consumer');
process.exit(1);
}
});
this._consumer.on('ready', () => {
consumerReady = true;
this._consumer.subscribe();
this.logger.info('lifecycle consumer successfully started');
return this.emit('ready');
Expand Down

0 comments on commit b475039

Please sign in to comment.