diff --git a/README.md b/README.md index 9acfa139..1011c865 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ I am looking for *your* help to make this project even better! If you're interes The `node-rdkafka` library is a high-performance NodeJS client for [Apache Kafka](http://kafka.apache.org/) that wraps the native [librdkafka](https://github.com/edenhill/librdkafka) library. All the complexity of balancing writes across partitions and managing (possibly ever-changing) brokers should be encapsulated in the library. -__This library currently uses `librdkafka` version `2.8.0`.__ +__This library currently uses `librdkafka` version `2.10.0`.__ ## Reference Docs @@ -60,7 +60,7 @@ Using Alpine Linux? Check out the [docs](https://github.com/Blizzard/node-rdkafk ### Windows -Windows build **is not** compiled from `librdkafka` source but it is rather linked against the appropriate version of [NuGet librdkafka.redist](https://www.nuget.org/packages/librdkafka.redist/) static binary that gets downloaded from `https://globalcdn.nuget.org/packages/librdkafka.redist.2.8.0.nupkg` during installation. This download link can be changed using the environment variable `NODE_RDKAFKA_NUGET_BASE_URL` that defaults to `https://globalcdn.nuget.org/packages/` when it's no set. +Windows build **is not** compiled from `librdkafka` source but it is rather linked against the appropriate version of [NuGet librdkafka.redist](https://www.nuget.org/packages/librdkafka.redist/) static binary that gets downloaded from `https://globalcdn.nuget.org/packages/librdkafka.redist.2.10.0.nupkg` during installation. This download link can be changed using the environment variable `NODE_RDKAFKA_NUGET_BASE_URL` that defaults to `https://globalcdn.nuget.org/packages/` when it's no set. Requirements: * [node-gyp for Windows](https://github.com/nodejs/node-gyp#on-windows) @@ -97,7 +97,7 @@ const Kafka = require('node-rdkafka'); ## Configuration -You can pass many configuration options to `librdkafka`. A full list can be found in `librdkafka`'s [Configuration.md](https://github.com/edenhill/librdkafka/blob/v2.8.0/CONFIGURATION.md) +You can pass many configuration options to `librdkafka`. A full list can be found in `librdkafka`'s [Configuration.md](https://github.com/edenhill/librdkafka/blob/v2.10.0/CONFIGURATION.md) Configuration keys that have the suffix `_cb` are designated as callbacks. Some of these keys are informational and you can choose to opt-in (for example, `dr_cb`). Others are callbacks designed to @@ -132,7 +132,7 @@ You can also get the version of `librdkafka` const Kafka = require('node-rdkafka'); console.log(Kafka.librdkafkaVersion); -// #=> 2.8.0 +// #=> 2.10.0 ``` ## Sending Messages @@ -145,7 +145,7 @@ const producer = new Kafka.Producer({ }); ``` -A `Producer` requires only `metadata.broker.list` (the Kafka brokers) to be created. The values in this list are separated by commas. For other configuration options, see the [Configuration.md](https://github.com/edenhill/librdkafka/blob/v2.8.0/CONFIGURATION.md) file described previously. +A `Producer` requires only `metadata.broker.list` (the Kafka brokers) to be created. The values in this list are separated by commas. For other configuration options, see the [Configuration.md](https://github.com/edenhill/librdkafka/blob/v2.10.0/CONFIGURATION.md) file described previously. The following example illustrates a list with several `librdkafka` options set. diff --git a/config.d.ts b/config.d.ts index ac3a5a66..3c5dc5de 100644 --- a/config.d.ts +++ b/config.d.ts @@ -1,4 +1,4 @@ -// ====== Generated from librdkafka 2.8.0 file CONFIGURATION.md ====== +// ====== Generated from librdkafka 2.10.0 file CONFIGURATION.md ====== // Code that generated this is a derivative work of the code from Nam Nguyen // https://gist.github.com/ntgn81/066c2c8ec5b4238f85d1e9168a04e3fb @@ -62,6 +62,13 @@ export interface GlobalConfig { */ "max.in.flight"?: number; + /** + * Controls how the client recovers when none of the brokers known to it is available. If set to `none`, the client fails with a fatal error. If set to `rebootstrap`, the client repeats the bootstrap process using `bootstrap.servers` and brokers added through `rd_kafka_brokers_add()`. Rebootstrapping is useful when a client communicates with brokers so infrequently that the set of brokers may change entirely before the client refreshes metadata. Metadata recovery is triggered when all last-known brokers appear unavailable simultaneously. + * + * @default rebootstrap + */ + "metadata.recovery.strategy"?: 'none' | 'rebootstrap'; + /** * Period of time in milliseconds at which topic and broker metadata is refreshed in order to proactively discover any new brokers, topics, partitions or partition leader changes. Use -1 to disable the intervalled refresh (not recommended). If there are no locally referenced topics (no topic objects created, no messages produced, no subscription or no assignment) then only the broker list will be refreshed every interval but no more often than every 10s. * @@ -152,7 +159,7 @@ export interface GlobalConfig { /** * Disable the Nagle algorithm (TCP_NODELAY) on broker sockets. * - * @default false + * @default true */ "socket.nagle.disable"?: boolean; @@ -329,7 +336,7 @@ export interface GlobalConfig { "internal.termination.signal"?: number; /** - * Request broker's supported API versions to adjust functionality to available protocol features. If set to false, or the ApiVersionRequest fails, the fallback version `broker.version.fallback` will be used. **NOTE**: Depends on broker version >=0.10.0. If the request is not supported by (an older) broker the `broker.version.fallback` fallback is used. + * **DEPRECATED** **Post-deprecation actions: remove this configuration property, brokers < 0.10.0 won't be supported anymore in librdkafka 3.x.** Request broker's supported API versions to adjust functionality to available protocol features. If set to false, or the ApiVersionRequest fails, the fallback version `broker.version.fallback` will be used. **NOTE**: Depends on broker version >=0.10.0. If the request is not supported by (an older) broker the `broker.version.fallback` fallback is used. * * @default true */ @@ -343,14 +350,14 @@ export interface GlobalConfig { "api.version.request.timeout.ms"?: number; /** - * Dictates how long the `broker.version.fallback` fallback is used in the case the ApiVersionRequest fails. **NOTE**: The ApiVersionRequest is only issued when a new connection to the broker is made (such as after an upgrade). + * **DEPRECATED** **Post-deprecation actions: remove this configuration property, brokers < 0.10.0 won't be supported anymore in librdkafka 3.x.** Dictates how long the `broker.version.fallback` fallback is used in the case the ApiVersionRequest fails. **NOTE**: The ApiVersionRequest is only issued when a new connection to the broker is made (such as after an upgrade). * * @default 0 */ "api.version.fallback.ms"?: number; /** - * Older broker versions (before 0.10.0) provide no way for a client to query for supported protocol features (ApiVersionRequest, see `api.version.request`) making it impossible for the client to know what features it may use. As a workaround a user may set this property to the expected broker version and the client will automatically adjust its feature set accordingly if the ApiVersionRequest fails (or is disabled). The fallback broker version will be used for `api.version.fallback.ms`. Valid values are: 0.9.0, 0.8.2, 0.8.1, 0.8.0. Any other value >= 0.10, such as 0.10.2.1, enables ApiVersionRequests. + * **DEPRECATED** **Post-deprecation actions: remove this configuration property, brokers < 0.10.0 won't be supported anymore in librdkafka 3.x.** Older broker versions (before 0.10.0) provide no way for a client to query for supported protocol features (ApiVersionRequest, see `api.version.request`) making it impossible for the client to know what features it may use. As a workaround a user may set this property to the expected broker version and the client will automatically adjust its feature set accordingly if the ApiVersionRequest fails (or is disabled). The fallback broker version will be used for `api.version.fallback.ms`. Valid values are: 0.9.0, 0.8.2, 0.8.1, 0.8.0. Any other value >= 0.10, such as 0.10.2.1, enables ApiVersionRequests. * * @default 0.10.0 */ @@ -796,28 +803,28 @@ export interface ConsumerGlobalConfig extends GlobalConfig { "group.instance.id"?: string; /** - * The name of one or more partition assignment strategies. The elected group leader will use a strategy supported by all members of the group to assign partitions to group members. If there is more than one eligible strategy, preference is determined by the order of this list (strategies earlier in the list have higher priority). Cooperative and non-cooperative (eager) strategies must not be mixed. Available strategies: range, roundrobin, cooperative-sticky. + * The name of one or more partition assignment strategies. The elected group leader will use a strategy supported by all members of the group to assign partitions to group members. If there is more than one eligible strategy, preference is determined by the order of this list (strategies earlier in the list have higher priority). Cooperative and non-cooperative (eager)strategies must not be mixed. `partition.assignment.strategy` is not supported for `group.protocol=consumer`. Use `group.remote.assignor` instead. Available strategies: range, roundrobin, cooperative-sticky. * * @default range,roundrobin */ "partition.assignment.strategy"?: string; /** - * Client group session and failure detection timeout. The consumer sends periodic heartbeats (heartbeat.interval.ms) to indicate its liveness to the broker. If no hearts are received by the broker for a group member within the session timeout, the broker will remove the consumer from the group and trigger a rebalance. The allowed range is configured with the **broker** configuration properties `group.min.session.timeout.ms` and `group.max.session.timeout.ms`. Also see `max.poll.interval.ms`. + * Client group session and failure detection timeout. The consumer sends periodic heartbeats (heartbeat.interval.ms) to indicate its liveness to the broker. If no hearts are received by the broker for a group member within the session timeout, the broker will remove the consumer from the group and trigger a rebalance. The allowed range is configured with the **broker** configuration properties `group.min.session.timeout.ms` and `group.max.session.timeout.ms`. `session.timeout.ms` is not supported for `group.protocol=consumer`. It is set with the broker configuration property `group.consumer.session.timeout.ms` by default or can be configured through the AdminClient IncrementalAlterConfigs API. The allowed range is configured with the broker configuration properties `group.consumer.min.session.timeout.ms` and `group.consumer.max.session.timeout.ms`. Also see `max.poll.interval.ms`. * * @default 45000 */ "session.timeout.ms"?: number; /** - * Group session keepalive heartbeat interval. + * Group session keepalive heartbeat interval. `heartbeat.interval.ms` is not supported for `group.protocol=consumer`. It is set with the broker configuration property `group.consumer.heartbeat.interval.ms` by default or can be configured through the AdminClient IncrementalAlterConfigs API. The allowed range is configured with the broker configuration properties `group.consumer.min.heartbeat.interval.ms` and `group.consumer.max.heartbeat.interval.ms`. * * @default 3000 */ "heartbeat.interval.ms"?: number; /** - * Group protocol type for the `classic` group protocol. NOTE: Currently, the only supported group protocol type is `consumer`. + * Group protocol type for the `classic` group protocol. NOTE: Currently, the only supported group protocol type is `consumer`. `group.protocol.type` is not supported for `group.protocol=consumer` * * @default consumer */ diff --git a/deps/librdkafka b/deps/librdkafka index b4c60857..c024ac13 160000 --- a/deps/librdkafka +++ b/deps/librdkafka @@ -1 +1 @@ -Subproject commit b4c608570f796c18ff2211a7af876046d264d392 +Subproject commit c024ac13daf98667de2b8724986e97f489644c15 diff --git a/errors.d.ts b/errors.d.ts index f7118784..5218b330 100644 --- a/errors.d.ts +++ b/errors.d.ts @@ -1,4 +1,4 @@ -// ====== Generated from librdkafka 2.8.0 file src-cpp/rdkafkacpp.h ====== +// ====== Generated from librdkafka 2.10.0 file src-cpp/rdkafkacpp.h ====== export const CODES: { ERRORS: { /* Internal errors to rdkafka: */ /** Begin internal error codes (**-200**) */ diff --git a/lib/error.js b/lib/error.js index c36d5e58..713a4675 100644 --- a/lib/error.js +++ b/lib/error.js @@ -27,7 +27,7 @@ LibrdKafkaError.wrap = errorWrap; * @enum {number} * @constant */ -// ====== Generated from librdkafka 2.8.0 file src-cpp/rdkafkacpp.h ====== +// ====== Generated from librdkafka 2.10.0 file src-cpp/rdkafkacpp.h ====== LibrdKafkaError.codes = { /* Internal errors to rdkafka: */ diff --git a/package-lock.json b/package-lock.json index c3c7c0ca..a1977119 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-rdkafka", - "version": "v3.3.1", + "version": "v3.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-rdkafka", - "version": "v3.3.1", + "version": "v3.4.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index d411ff71..e54cfbf0 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "node-rdkafka", - "version": "v3.3.1", + "version": "v3.4.0", "description": "Node.js bindings for librdkafka", - "librdkafka": "2.8.0", + "librdkafka": "2.10.0", "main": "lib/index.js", "scripts": { "configure": "node-gyp configure",