From 09b36861ed48e791d346a976e9043ccdc33ac37f Mon Sep 17 00:00:00 2001 From: Dotan Date: Thu, 10 Oct 2019 16:24:53 +0300 Subject: [PATCH 1/2] Make socket keepAlive time configurable --- lib/kafkaClient.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/kafkaClient.js b/lib/kafkaClient.js index 1debd7bd..27e15f69 100644 --- a/lib/kafkaClient.js +++ b/lib/kafkaClient.js @@ -43,7 +43,8 @@ const DEFAULTS = { randomize: true }, maxAsyncRequests: 10, - noAckBatchOptions: null + noAckBatchOptions: null, + socketKeepAlive: 60000 }; const KafkaClient = function (options) { @@ -796,7 +797,7 @@ KafkaClient.prototype.createBroker = function (host, port, longpolling) { socket.buffer.append(data); self.handleReceivedData(socket); }); - socket.setKeepAlive(true, 60000); + socket.setKeepAlive(true, self.options.socketKeepAlive); const brokerWrapper = new BrokerWrapper( socket, From e8e0dce69447f73b31e8b0b14de023fdcf4a7e93 Mon Sep 17 00:00:00 2001 From: Dotan Date: Fri, 10 Jan 2020 15:48:08 +0200 Subject: [PATCH 2/2] Empty commit