From 5d28f542a82ef3b77439b4e08c1ff8211d818b24 Mon Sep 17 00:00:00 2001 From: James Ward Date: Tue, 12 Jun 2018 16:31:01 -0400 Subject: [PATCH] use 'buffer' for default JS Kafka encoding this makes the messages consumed by the JS Kafka Client match the native librdkafka backend and create buffers for the key and value this also makes the JS Kafka client match the documentation. --- lib/kafka/Kafka.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/kafka/Kafka.js b/lib/kafka/Kafka.js index fe5620c..1ae8ccb 100644 --- a/lib/kafka/Kafka.js +++ b/lib/kafka/Kafka.js @@ -180,7 +180,9 @@ class Kafka extends EventEmitter { fetchMaxWaitMs: 100, autoCommit: autoCommit, autoCommitIntervalMs: 5000, - connectRetryOptions: this.connectDirectlyToBroker ? DEFAULT_RETRY_OPTIONS : undefined + connectRetryOptions: this.connectDirectlyToBroker ? DEFAULT_RETRY_OPTIONS : undefined, + encoding: "buffer", + keyEncoding: "buffer" }; //overwrite default options