diff --git a/README.md b/README.md index 1252506..f171e7d 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ Standard node consumer/producer implementation for QuintoAndar. ## Examples -See [exemples folder](/example) +See [examples folder](/example) ## Configuration -Checkout [kafka-node repo](https://github.com/SOHU-Co/kafka-node) for configuration info. \ No newline at end of file +Checkout [kafka-node repo](https://github.com/SOHU-Co/kafka-node) for configuration info. diff --git a/package.json b/package.json index 5be9a22..e1a3257 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "quintoandar-kafka", - "version": "0.2.2", + "version": "0.2.3", "description": "Default Kafka NodeJS lib for QuintoAndar", "main": "src/main.js", "types": "types/index.d.ts", diff --git a/src/node-kafka-consumer.js b/src/node-kafka-consumer.js index 98b4271..5d94772 100644 --- a/src/node-kafka-consumer.js +++ b/src/node-kafka-consumer.js @@ -36,7 +36,7 @@ class KafkaConsumer { init() { this.consumer = new kafka.ConsumerGroupStream(this.configs, this.topics); this.consumer.on('error', (err) => { - logger.error('node-kafka error: ', err); + logger.error('node-kafka error:', err); process.exit(1); }); @@ -44,8 +44,10 @@ class KafkaConsumer { this.handleMessageFn(msg).then(() => { this.consumer.commit(msg, true); }).catch((err) => { - logger.error(`Consumer error on handleMessageFn: ${err}. - The following message was not committed: ${msg}`); + logger.error( + 'The following message was not committed:', msg, + 'Consumer error on handleMessageFn:', err + ); }); }); @@ -58,7 +60,7 @@ class KafkaConsumer { this.consumer.consumerGroup.topics, (err) => { if (err) { - logger.warn('Refresh metadata error: ', err); + logger.warn('Refresh metadata error:', err); if (err.name === 'BrokerNotAvailableError') { this.consumer.close(() => { process.exit(1);