New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

no-kafka

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

no-kafka - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

2

lib/base_consumer.js

@@ -11,3 +11,3 @@ 'use strict';

this.options = _.defaultsDeep(options || {}, {
timeout: 100, // client timeout for produce and fetch requests
maxWaitTime: 100,
idleTimeout: 1000, // timeout between fetch requests

@@ -14,0 +14,0 @@ minBytes: 1,

@@ -284,2 +284,6 @@ 'use strict';

if (self.options.requiredAcks !== 0) {
// TODO: ThrottleTime is returned in V1 so we should change the return value soon
// [ topics, throttleTime ] or { topics, throttleTime }
// first one will allow to just use .spread instead of .then
// second will be more generic but probably require more changes to the user code
return self.protocol.read(responseBuffer).ProduceResponse().result.topics;

@@ -313,3 +317,3 @@ }

clientId: self.options.clientId,
timeout: self.options.timeout,
maxWaitTime: self.options.maxWaitTime,
minBytes: self.options.minBytes,

@@ -320,2 +324,6 @@ topics: topics

return self.brokerConnections[leader].send(buffer).then(function (responseBuffer) {
// TODO: ThrottleTime is returned in V1 so we should change the return value soon
// [ topics, throttleTime ] or { topics, throttleTime }
// first one will allow to just use .spread instead of .then
// second will be more generic but probably require more changes to the user code
return self.protocol.read(responseBuffer).FetchResponse().result.topics;

@@ -322,0 +330,0 @@ })

@@ -30,3 +30,3 @@ 'use strict';

Protocol.define('FetchRequest', {
write: function (data) { // { timeout, minBytes, topics }
write: function (data) { // { maxWaitTime, minBytes, topics }
this

@@ -40,3 +40,3 @@ .RequestHeader({

.Int32BE(data.replicaId || -1) // ReplicaId
.Int32BE(data.timeout)
.Int32BE(data.maxWaitTime)
.Int32BE(data.minBytes)

@@ -70,4 +70,5 @@ .array(data.topics, this.FetchRequestTopicItem);

.Int32BE('correlationId')
// .Int32BE('throttleTime')
.array('topics', this.FetchResponseTopicItem);
}
});

@@ -30,3 +30,3 @@ 'use strict';

Protocol.define('OffsetRequest', {
write: function (data) { // { topics }
write: function (data) { // { replicaId, topics }
this

@@ -33,0 +33,0 @@ .RequestHeader({

@@ -40,3 +40,3 @@ 'use strict';

apiKey: globals.API_KEYS.ProduceRequest,
apiVersion: 0,
apiVersion: 1,
correlationId: data.correlationId,

@@ -72,4 +72,5 @@ clientId: data.clientId

.Int32BE('correlationId')
.array('topics', this.ProduceResponseTopicItem);
.array('topics', this.ProduceResponseTopicItem)
.Int32BE('throttleTime');
}
});

@@ -9,3 +9,3 @@ {

},
"version": "2.1.2",
"version": "2.2.0",
"main": "./lib/index.js",

@@ -12,0 +12,0 @@ "keywords": [

@@ -27,2 +27,3 @@ [![Build Status][badge-travis]][travis]

* [Logging](#logging)
* [Topic Creation](#topic-creation)
* [License](#license)

@@ -243,3 +244,3 @@

* `groupId` - group ID for comitting and fetching offsets. Defaults to 'no-kafka-group-v0'
* `timeout` - timeout for fetch requests, defaults to 100ms
* `maxWaitTime` - maximum amount of time in milliseconds to block waiting if insufficient data is available at the time the fetch request is issued, defaults to 100ms
* `idleTimeout` - timeout between fetch calls, defaults to 1000ms

@@ -336,3 +337,3 @@ * `minBytes` - minimum number of bytes to wait from Kafka before returning the fetch call, defaults to 1 byte

* `groupId` - group ID for comitting and fetching offsets. Defaults to 'no-kafka-group-v0.9'
* `timeout` - timeout for fetch requests, defaults to 100ms
* `maxWaitTime` - maximum amount of time in milliseconds to block waiting if insufficient data is available at the time the fetch request is issued, defaults to 100ms
* `idleTimeout` - timeout between fetch calls, defaults to 1000ms

@@ -499,2 +500,6 @@ * `minBytes` - minimum number of bytes to wait from Kafka before returning the fetch call, defaults to 1 byte

## Topic Creation
There is no Kafka API call to create a topic. Kafka supports auto creating of topics when their metadata is first requested (`auto.create.topic` option) but the topic is created with all default parameters, which is useless. For this reason __no-kafka__ doesn't support this behaviour until there will be a specific Kafka API call to create/manage topics.
## License: [MIT](https://github.com/oleksiyk/kafka/blob/master/LICENSE)

@@ -501,0 +506,0 @@

Sorry, the diff of this file is not supported yet

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