Skip to content

Commit 37ec22c

Browse files
authored
Update to librdkafka 2.0.2 (#996)
1 parent 9ffc9c6 commit 37ec22c

File tree

9 files changed

+40
-32
lines changed

9 files changed

+40
-32
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ Steps to update:
207207
git checkout 063a9ae7a65cebdf1cc128da9815c05f91a2a996 # for version 1.8.2
208208
```
209209

210+
If you get an error during that checkout command, double check that the submodule was initialized / cloned! You may need to run `git submodule update --init --recursive`
211+
210212
1. Update [`config.d.ts`](https://github.com/Blizzard/node-rdkafka/blob/master/config.d.ts) and [`errors.d.ts`](https://github.com/Blizzard/node-rdkafka/blob/master/errors.d.ts) TypeScript definitions by running:
211213
```bash
212214
node ci/librdkafka-defs-generator.js

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ I am looking for *your* help to make this project even better! If you're interes
1717

1818
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.
1919

20-
__This library currently uses `librdkafka` version `1.9.2`.__
20+
__This library currently uses `librdkafka` version `2.0.2`.__
2121

2222
## Reference Docs
2323

@@ -60,7 +60,7 @@ Using Alpine Linux? Check out the [docs](https://github.com/Blizzard/node-rdkafk
6060

6161
### Windows
6262

63-
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.1.9.2.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.
63+
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.0.2.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.
6464

6565
Requirements:
6666
* [node-gyp for Windows](https://github.com/nodejs/node-gyp#on-windows)
@@ -97,7 +97,7 @@ var Kafka = require('node-rdkafka');
9797

9898
## Configuration
9999

100-
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/v1.9.2/CONFIGURATION.md)
100+
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.0.2/CONFIGURATION.md)
101101

102102
Configuration keys that have the suffix `_cb` are designated as callbacks. Some
103103
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`
132132
const Kafka = require('node-rdkafka');
133133
console.log(Kafka.librdkafkaVersion);
134134

135-
// #=> 1.9.2
135+
// #=> 2.0.2
136136
```
137137

138138
## Sending Messages
@@ -145,7 +145,7 @@ var producer = new Kafka.Producer({
145145
});
146146
```
147147

148-
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/v1.9.2/CONFIGURATION.md) file described previously.
148+
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.0.2/CONFIGURATION.md) file described previously.
149149

150150
The following example illustrates a list with several `librdkafka` options set.
151151

config.d.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ====== Generated from librdkafka 1.9.2 file CONFIGURATION.md ======
1+
// ====== Generated from librdkafka 2.0.2 file CONFIGURATION.md ======
22
// Code that generated this is a derivative work of the code from Nam Nguyen
33
// https://gist.github.com/ntgn81/066c2c8ec5b4238f85d1e9168a04e3fb
44

@@ -306,6 +306,11 @@ export interface GlobalConfig {
306306
*/
307307
"open_cb"?: any;
308308

309+
/**
310+
* Address resolution callback (set with rd_kafka_conf_set_resolve_cb()).
311+
*/
312+
"resolve_cb"?: any;
313+
309314
/**
310315
* Application opaque (set with rd_kafka_conf_set_opaque())
311316
*/
@@ -351,6 +356,13 @@ export interface GlobalConfig {
351356
*/
352357
"broker.version.fallback"?: string;
353358

359+
/**
360+
* Allow automatic topic creation on the broker when subscribing to or assigning non-existent topics. The broker must also be configured with `auto.create.topics.enable=true` for this configuration to take effect. Note: the default value (true) for the producer is different from the default value (false) for the consumer. Further, the consumer default value is different from the Java consumer (true), and this property is not supported by the Java producer. Requires broker version >= 0.11.0.0, for older broker versions only the broker configuration applies.
361+
*
362+
* @default false
363+
*/
364+
"allow.auto.create.topics"?: boolean;
365+
354366
/**
355367
* Protocol used to communicate with brokers.
356368
*
@@ -446,7 +458,12 @@ export interface GlobalConfig {
446458
"ssl.keystore.password"?: string;
447459

448460
/**
449-
* Path to OpenSSL engine library. OpenSSL >= 1.1.0 required.
461+
* Comma-separated list of OpenSSL 3.0.x implementation providers. E.g., "default,legacy".
462+
*/
463+
"ssl.providers"?: string;
464+
465+
/**
466+
* **DEPRECATED** Path to OpenSSL engine library. OpenSSL >= 1.1.x required. DEPRECATED: OpenSSL engine support is deprecated and should be replaced by OpenSSL 3 providers.
450467
*/
451468
"ssl.engine.location"?: string;
452469

@@ -472,7 +489,7 @@ export interface GlobalConfig {
472489
/**
473490
* Endpoint identification algorithm to validate broker hostname using broker certificate. https - Server (broker) hostname verification as specified in RFC2818. none - No endpoint verification. OpenSSL >= 1.0.2 required.
474491
*
475-
* @default none
492+
* @default https
476493
*/
477494
"ssl.endpoint.identification.algorithm"?: 'none' | 'https';
478495

@@ -638,7 +655,7 @@ export interface ProducerGlobalConfig extends GlobalConfig {
638655
"enable.gapless.guarantee"?: boolean;
639656

640657
/**
641-
* Maximum number of messages allowed on the producer queue. This queue is shared by all topics and partitions.
658+
* Maximum number of messages allowed on the producer queue. This queue is shared by all topics and partitions. A value of 0 disables this limit.
642659
*
643660
* @default 100000
644661
*/
@@ -918,13 +935,6 @@ export interface ConsumerGlobalConfig extends GlobalConfig {
918935
* @default false
919936
*/
920937
"check.crcs"?: boolean;
921-
922-
/**
923-
* Allow automatic topic creation on the broker when subscribing to or assigning non-existent topics. The broker must also be configured with `auto.create.topics.enable=true` for this configuraiton to take effect. Note: The default value (false) is different from the Java consumer (true). Requires broker version >= 0.11.0.0, for older broker versions only the broker configuration applies.
924-
*
925-
* @default false
926-
*/
927-
"allow.auto.create.topics"?: boolean;
928938
}
929939

930940
export interface TopicConfig {

deps/librdkafka

deps/windows-install.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# read librdkafka version from package.json
33
import json
44
import os
5+
import glob
6+
57
with open('../package.json') as f:
68
librdkafkaVersion = json.load(f)['librdkafka']
79
librdkafkaWinSufix = '7' if librdkafkaVersion == '0.11.5' else '';
@@ -62,15 +64,9 @@ def createdir(dir):
6264
shutil.copy2(includePath + '/rdkafka.h', depsIncludeDir)
6365
shutil.copy2(includePath + '/rdkafkacpp.h', depsIncludeDir)
6466

65-
shutil.copy2(dllPath + '/libcrypto-1_1-x64.dll', buildReleaseDir)
66-
shutil.copy2(dllPath + '/libcurl.dll', buildReleaseDir)
67-
shutil.copy2(dllPath + '/librdkafka.dll', buildReleaseDir)
68-
shutil.copy2(dllPath + '/librdkafkacpp.dll', buildReleaseDir)
69-
shutil.copy2(dllPath + '/libssl-1_1-x64.dll', buildReleaseDir)
70-
shutil.copy2(dllPath + '/msvcp140.dll', buildReleaseDir)
71-
shutil.copy2(dllPath + '/vcruntime140.dll', buildReleaseDir)
72-
shutil.copy2(dllPath + '/zlib1.dll', buildReleaseDir)
73-
shutil.copy2(dllPath + '/zstd.dll', buildReleaseDir)
67+
# copy all the required dlls
68+
for filename in glob.glob(os.path.join(dllPath, '*.dll')):
69+
shutil.copy2(filename, buildReleaseDir)
7470

7571
# clean up
7672
os.remove(outputFile)

errors.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ====== Generated from librdkafka 1.9.2 file src-cpp/rdkafkacpp.h ======
1+
// ====== Generated from librdkafka 2.0.2 file src-cpp/rdkafkacpp.h ======
22
export const CODES: { ERRORS: {
33
/* Internal errors to rdkafka: */
44
/** Begin internal error codes (**-200**) */

lib/error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LibrdKafkaError.wrap = errorWrap;
2727
* @enum {number}
2828
* @constant
2929
*/
30-
// ====== Generated from librdkafka 1.9.2 file src-cpp/rdkafkacpp.h ======
30+
// ====== Generated from librdkafka 2.0.2 file src-cpp/rdkafkacpp.h ======
3131
LibrdKafkaError.codes = {
3232

3333
/* Internal errors to rdkafka: */

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "node-rdkafka",
3-
"version": "v2.14.6",
3+
"version": "v2.15.0",
44
"description": "Node.js bindings for librdkafka",
5-
"librdkafka": "1.9.2",
5+
"librdkafka": "2.0.2",
66
"main": "lib/index.js",
77
"scripts": {
88
"configure": "node-gyp configure",

0 commit comments

Comments
 (0)