diff --git a/lib/kafkaClient.js b/lib/kafkaClient.js index 98164574..7fb4d25e 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,