kafka-node
Advanced tools
Comparing version 1.0.5 to 1.0.6
# kafka-node CHANGELOG | ||
## 2016-11-15, Version 1.0.6 | ||
- Fix leave group exception that can occur in [Consumer Group](https://github.com/SOHU-Co/kafka-node#consumergroup) [#513](https://github.com/SOHU-Co/kafka-node/pull/513) | ||
## 2016-11-03, Version 1.0.5 | ||
@@ -4,0 +7,0 @@ - Update doc added how to list all topics [#503](https://github.com/SOHU-Co/kafka-node/pull/503) |
@@ -401,3 +401,3 @@ 'use strict'; | ||
this.stopHeartbeats(); | ||
if (self.generationId != null) { | ||
if (self.generationId != null && self.memberId) { | ||
this.client.sendLeaveGroupRequest(this.options.groupId, this.memberId, function (error) { | ||
@@ -404,0 +404,0 @@ self.generationId = null; |
@@ -12,3 +12,3 @@ { | ||
"bugs": "https://github.com/SOHU-co/kafka-node/issues", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"main": "kafka.js", | ||
@@ -15,0 +15,0 @@ "license": "MIT", |
@@ -101,2 +101,33 @@ 'use strict'; | ||
describe('#close', function () { | ||
let sandbox, consumerGroup; | ||
beforeEach(function () { | ||
sandbox = sinon.sandbox.create(); | ||
consumerGroup = new ConsumerGroup({ | ||
host: host, | ||
connectOnReady: false, | ||
sessionTimeout: 8000, | ||
heartbeatInterval: 250, | ||
retryMinTimeout: 250 | ||
}, 'TestTopic'); | ||
}); | ||
afterEach(function () { | ||
sandbox.restore(); | ||
}); | ||
it('should not throw an exception when closing immediately after an UnknownMemberId error', function (done) { | ||
const UnknownMemberId = require('../lib/errors/UnknownMemberIdError'); | ||
sandbox.stub(consumerGroup.client, 'sendHeartbeatRequest').yields(new UnknownMemberId('test')); | ||
should.doesNotThrow(function () { | ||
consumerGroup.connect(); | ||
consumerGroup.once('connect', function () { | ||
consumerGroup.close(done); | ||
}); | ||
}); | ||
}); | ||
}); | ||
describe('#sendHeartbeats', function () { | ||
@@ -103,0 +134,0 @@ var consumerGroup, sandbox; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
351949
8485