Skip to content

Commit

Permalink
Make socket keepAlive time configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
dotanrs committed Oct 10, 2019
1 parent 51b6292 commit 34fe4f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/kafkaClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const DEFAULTS = {
randomize: true
},
maxAsyncRequests: 10,
noAckBatchOptions: null
noAckBatchOptions: null,
socketKeepAlive: 60000
};

const KafkaClient = function (options) {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 34fe4f3

Please sign in to comment.