Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kafka-node

Package Overview
Dependencies
Maintainers
3
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kafka-node - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

4

CHANGELOG.md
# kafka-node CHANGELOG
## 2017-05-04, Version 1.6.1
* Fix `Offset` calling `.fetchOffset` methods not yielding callback when the topic does not exist [#662](https://github.com/SOHU-Co/kafka-node/pull/662)
* Improved performance of Client using `BufferList` instead of `Buffer.slice` [#654](https://github.com/SOHU-Co/kafka-node/pull/654)
## 2017-03-16, Version 1.6.0

@@ -4,0 +8,0 @@ * Add ability to provide your own custom partitioner implementation (see docs for Producer) [#625](https://github.com/SOHU-Co/kafka-node/pull/625)

23

lib/client.js

@@ -12,3 +12,2 @@ 'use strict';

var errors = require('./errors');
var Binary = require('binary');
var getCodec = require('./codec');

@@ -25,2 +24,3 @@ var protocol = require('./protocol');

var validateKafkaTopics = require('./utils').validateTopicNames;
var BufferList = require('bl');

@@ -699,6 +699,6 @@ const MAX_INT32 = 2147483647;

});
socket.buffer = new Buffer([]);
socket.buffer = new BufferList();
socket.on('data', function (data) {
this.buffer = Buffer.concat([this.buffer, data]);
self.handleReceivedData(this);
socket.buffer.append(data);
self.handleReceivedData(socket);
});

@@ -729,8 +729,11 @@ socket.setKeepAlive(true, 60000);

Client.prototype.handleReceivedData = function (socket) {
var vars = Binary.parse(socket.buffer).word32bu('size').word32bu('correlationId').vars;
var size = vars.size + 4;
var correlationId = vars.correlationId;
var buffer = socket.buffer;
if (!buffer.length) {
return;
}
var size = buffer.readUInt32BE(0) + 4;
if (socket.buffer.length >= size) {
var resp = socket.buffer.slice(0, size);
if (buffer.length >= size) {
var resp = buffer.shallowSlice(0, size);
var correlationId = resp.readUInt32BE(4);
var handlers = this.unqueueCallback(socket, correlationId);

@@ -745,3 +748,3 @@

: cb.call(this, null, result);
socket.buffer = socket.buffer.slice(size);
buffer.consume(size);
if (socket.longpolling) socket.waiting = false;

@@ -748,0 +751,0 @@ } else { return; }

@@ -93,2 +93,7 @@ 'use strict';

});
if (payloads.length === 0) {
return callback(new Error('Topic(s) does not exist'));
}
offset.fetch(payloads, callback);

@@ -95,0 +100,0 @@ },

@@ -129,4 +129,3 @@ 'use strict';

if (error) {
callback(error);
return;
return callback(error);
} else {

@@ -133,0 +132,0 @@ logger.debug('Children are: %j.', children);

@@ -11,5 +11,9 @@ {

],
"files": ["kafka.js", "logging.js", "lib"],
"files": [
"kafka.js",
"logging.js",
"lib"
],
"bugs": "https://github.com/SOHU-co/kafka-node/issues",
"version": "1.6.0",
"version": "1.6.1",
"main": "kafka.js",

@@ -20,2 +24,3 @@ "license": "MIT",

"binary": "~0.3.0",
"bl": "^1.2.0",
"buffer-crc32": "~0.2.5",

@@ -41,8 +46,9 @@ "buffermaker": "~1.2.0",

"doctoc": "^1.2.0",
"eslint": "^3.7.0",
"eslint-config-semistandard": "^7.0.0",
"eslint-config-standard": "^6.2.0",
"eslint-plugin-dependencies": "^1.3.0",
"eslint": "^3.17.1",
"eslint-config-semistandard": "^8.0.0",
"eslint-config-standard": "^7.0.1",
"eslint-plugin-dependencies": "^2.2.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^2.0.1",
"execa": "^0.6.1",
"istanbul": "^0.4.4",

@@ -54,3 +60,3 @@ "mocha": "^3.1.0",

"should": "^6.0.0",
"sinon": "^1.17.2"
"sinon": "^2.0.0"
},

@@ -57,0 +63,0 @@ "repository": {

@@ -557,3 +557,3 @@ Kafka-node

API is very similar to `HighLevelConsumer` with some exceptions noted below:
API is very similar to `HighLevelConsumer` since it extends directly from HLC so many of the same options will apply with some exceptions noted below:

@@ -560,0 +560,0 @@ * In an effort to make the API simpler you no longer need to create a `client` this is done inside the `ConsumerGroup`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc