Skip to content

Commit 8cf4188

Browse files
authored
Update librdkafka from 1.8.2 -> 1.9.2 (#961)
1 parent 5dd0db6 commit 8cf4188

File tree

8 files changed

+74
-34
lines changed

8 files changed

+74
-34
lines changed

README.md

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

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

19-
__This library currently uses `librdkafka` version `1.8.2`.__
19+
__This library currently uses `librdkafka` version `1.9.2`.__
2020

2121
## Reference Docs
2222

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

6060
### Windows
6161

62-
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.8.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.
62+
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.
6363

6464
Requirements:
6565
* [node-gyp for Windows](https://github.com/nodejs/node-gyp#on-windows) (the easies way to get it: `npm install --global --production windows-build-tools`, if your node version is 6.x or below, pleasse use `npm install --global --production [email protected]`)
@@ -96,7 +96,7 @@ var Kafka = require('node-rdkafka');
9696

9797
## Configuration
9898

99-
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.8.2/CONFIGURATION.md)
99+
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)
100100

101101
Configuration keys that have the suffix `_cb` are designated as callbacks. Some
102102
of these keys are informational and you can choose to opt-in (for example, `dr_cb`). Others are callbacks designed to
@@ -131,7 +131,7 @@ You can also get the version of `librdkafka`
131131
const Kafka = require('node-rdkafka');
132132
console.log(Kafka.librdkafkaVersion);
133133

134-
// #=> 1.8.2
134+
// #=> 1.9.2
135135
```
136136

137137
## Sending Messages
@@ -144,7 +144,7 @@ var producer = new Kafka.Producer({
144144
});
145145
```
146146

147-
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.8.2/CONFIGURATION.md) file described previously.
147+
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.
148148

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

ci/librdkafka-defs-generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function updateErrorDefinitions(file) {
171171

172172
// validate body
173173
const emptyCheck = body
174-
.replace(/(( \/\*)|( ?\*)).*/g, '')
174+
.replace(/((\s+\/\*)|( ?\*)).*/g, '')
175175
.replace(/ ERR_\w+: -?\d+,?\r?\n/g, '')
176176
.trim()
177177
if (emptyCheck !== '') {

config.d.ts

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// ====== Generated from librdkafka 1.8.2 file CONFIGURATION.md ======
1+
// ====== Generated from librdkafka 1.9.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

55
export interface GlobalConfig {
66
/**
77
* Indicates the builtin features for this build of librdkafka. An application can either query this value or attempt to set it with its list of required features to check for library support.
88
*
9-
* @default gzip, snappy, ssl, sasl, regex, lz4, sasl_gssapi, sasl_plain, sasl_scram, plugins, zstd, sasl_oauthbearer
9+
* @default gzip, snappy, ssl, sasl, regex, lz4, sasl_gssapi, sasl_plain, sasl_scram, plugins, zstd, sasl_oauthbearer, http, oidc
1010
*/
1111
"builtin.features"?: string;
1212

@@ -177,6 +177,13 @@ export interface GlobalConfig {
177177
*/
178178
"broker.address.family"?: 'any' | 'v4' | 'v6';
179179

180+
/**
181+
* Maximum time allowed for broker connection setup (TCP connection setup as well SSL and SASL handshake). If the connection to the broker is not fully functional after this the connection will be closed and retried.
182+
*
183+
* @default 30000
184+
*/
185+
"socket.connection.setup.timeout.ms"?: number;
186+
180187
/**
181188
* Close broker connections after the specified time of inactivity. Disable with 0. If this property is left at its default value some heuristics are performed to determine a suitable default value, this is currently limited to identifying brokers on Azure (see librdkafka issue #3109 for more info).
182189
*
@@ -268,7 +275,7 @@ export interface GlobalConfig {
268275
"enable.random.seed"?: boolean;
269276

270277
/**
271-
* Log broker disconnects. It might be useful to turn this off when interacting with 0.9 brokers with an aggressive `connection.max.idle.ms` value.
278+
* Log broker disconnects. It might be useful to turn this off when interacting with 0.9 brokers with an aggressive `connections.max.idle.ms` value.
272279
*
273280
* @default true
274281
*/
@@ -544,10 +551,42 @@ export interface GlobalConfig {
544551
"enable.sasl.oauthbearer.unsecure.jwt"?: boolean;
545552

546553
/**
547-
* SASL/OAUTHBEARER token refresh callback (set with rd_kafka_conf_set_oauthbearer_token_refresh_cb(), triggered by rd_kafka_poll(), et.al. This callback will be triggered when it is time to refresh the client's OAUTHBEARER token.
554+
* SASL/OAUTHBEARER token refresh callback (set with rd_kafka_conf_set_oauthbearer_token_refresh_cb(), triggered by rd_kafka_poll(), et.al. This callback will be triggered when it is time to refresh the client's OAUTHBEARER token. Also see `rd_kafka_conf_enable_sasl_queue()`.
548555
*/
549556
"oauthbearer_token_refresh_cb"?: any;
550557

558+
/**
559+
* Set to "default" or "oidc" to control which login method to be used. If set to "oidc", the following properties must also be be specified: `sasl.oauthbearer.client.id`, `sasl.oauthbearer.client.secret`, and `sasl.oauthbearer.token.endpoint.url`.
560+
*
561+
* @default default
562+
*/
563+
"sasl.oauthbearer.method"?: 'default' | 'oidc';
564+
565+
/**
566+
* Public identifier for the application. Must be unique across all clients that the authorization server handles. Only used when `sasl.oauthbearer.method` is set to "oidc".
567+
*/
568+
"sasl.oauthbearer.client.id"?: string;
569+
570+
/**
571+
* Client secret only known to the application and the authorization server. This should be a sufficiently random string that is not guessable. Only used when `sasl.oauthbearer.method` is set to "oidc".
572+
*/
573+
"sasl.oauthbearer.client.secret"?: string;
574+
575+
/**
576+
* Client use this to specify the scope of the access request to the broker. Only used when `sasl.oauthbearer.method` is set to "oidc".
577+
*/
578+
"sasl.oauthbearer.scope"?: string;
579+
580+
/**
581+
* Allow additional information to be provided to the broker. Comma-separated list of key=value pairs. E.g., "supportFeatureX=true,organizationId=sales-emea".Only used when `sasl.oauthbearer.method` is set to "oidc".
582+
*/
583+
"sasl.oauthbearer.extensions"?: string;
584+
585+
/**
586+
* OAuth/OIDC issuer token endpoint HTTP(S) URI used to retrieve token. Only used when `sasl.oauthbearer.method` is set to "oidc".
587+
*/
588+
"sasl.oauthbearer.token.endpoint.url"?: string;
589+
551590
/**
552591
* List of plugin libraries to load (; separated). The library search path is platform dependent (see dlopen(3) for Unix and LoadLibrary() for Windows). If no filename extension is specified the platform-specific extension (such as .dll or .so) will be appended automatically.
553592
*/

deps/librdkafka

deps/windows-install.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
outputDir = 'librdkafka.redist'
1919
outputFile = outputDir + '.zip'
2020
dllPath = outputDir + '/runtimes/win{}-x64/native'.format(librdkafkaWinSufix)
21-
libPath = outputDir + '/build/native/lib/win{}/x64/win{}-x64-Release/v140'.format(librdkafkaWinSufix, librdkafkaWinSufix)
21+
libPath = outputDir + '/build/native/lib/win{}/x64/win{}-x64-Release/v142'.format(librdkafkaWinSufix, librdkafkaWinSufix)
2222
includePath = outputDir + '/build/native/include/librdkafka'
2323

2424
# download librdkafka from nuget
@@ -63,6 +63,7 @@ def createdir(dir):
6363
shutil.copy2(includePath + '/rdkafkacpp.h', depsIncludeDir)
6464

6565
shutil.copy2(dllPath + '/libcrypto-1_1-x64.dll', buildReleaseDir)
66+
shutil.copy2(dllPath + '/libcurl.dll', buildReleaseDir)
6667
shutil.copy2(dllPath + '/librdkafka.dll', buildReleaseDir)
6768
shutil.copy2(dllPath + '/librdkafkacpp.dll', buildReleaseDir)
6869
shutil.copy2(dllPath + '/libssl-1_1-x64.dll', buildReleaseDir)

errors.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ====== Generated from librdkafka 1.8.2 file src-cpp/rdkafkacpp.h ======
1+
// ====== Generated from librdkafka 1.9.2 file src-cpp/rdkafkacpp.h ======
22
export const CODES: { ERRORS: {
33
/* Internal errors to rdkafka: */
44
/** Begin internal error codes (**-200**) */
@@ -20,15 +20,15 @@ export const CODES: { ERRORS: {
2020
/** Produced message timed out (**-192**) */
2121
ERR__MSG_TIMED_OUT: number,
2222
/** Reached the end of the topic+partition queue on
23-
* the broker. Not really an error.
24-
* This event is disabled by default,
25-
* see the `enable.partition.eof` configuration property (**-191**) */
23+
* the broker. Not really an error.
24+
* This event is disabled by default,
25+
* see the `enable.partition.eof` configuration property (**-191**) */
2626
ERR__PARTITION_EOF: number,
2727
/** Permanent: Partition does not exist in cluster (**-190**) */
2828
ERR__UNKNOWN_PARTITION: number,
2929
/** File or filesystem error (**-189**) */
3030
ERR__FS: number,
31-
/** Permanent: Topic does not exist in cluster (**-188**) */
31+
/** Permanent: Topic does not exist in cluster (**-188**) */
3232
ERR__UNKNOWN_TOPIC: number,
3333
/** All broker connections are down (**-187**) */
3434
ERR__ALL_BROKERS_DOWN: number,
@@ -50,9 +50,9 @@ export const CODES: { ERRORS: {
5050
ERR__UNKNOWN_GROUP: number,
5151
/** Operation in progress (**-178**) */
5252
ERR__IN_PROGRESS: number,
53-
/** Previous operation in progress, wait for it to finish (**-177**) */
53+
/** Previous operation in progress, wait for it to finish (**-177**) */
5454
ERR__PREV_IN_PROGRESS: number,
55-
/** This operation would interfere with an existing subscription (**-176**) */
55+
/** This operation would interfere with an existing subscription (**-176**) */
5656
ERR__EXISTING_SUBSCRIPTION: number,
5757
/** Assigned partitions (rebalance_cb) (**-175**) */
5858
ERR__ASSIGN_PARTITIONS: number,
@@ -163,15 +163,15 @@ export const CODES: { ERRORS: {
163163
ERR_NETWORK_EXCEPTION: number,
164164
/** Coordinator load in progress (**14**) */
165165
ERR_COORDINATOR_LOAD_IN_PROGRESS: number,
166-
/** Group coordinator load in progress (**14**) */
166+
/** Group coordinator load in progress (**14**) */
167167
ERR_GROUP_LOAD_IN_PROGRESS: number,
168168
/** Coordinator not available (**15**) */
169169
ERR_COORDINATOR_NOT_AVAILABLE: number,
170-
/** Group coordinator not available (**15**) */
170+
/** Group coordinator not available (**15**) */
171171
ERR_GROUP_COORDINATOR_NOT_AVAILABLE: number,
172172
/** Not coordinator (**16**) */
173173
ERR_NOT_COORDINATOR: number,
174-
/** Not coordinator for group (**16**) */
174+
/** Not coordinator for group (**16**) */
175175
ERR_NOT_COORDINATOR_FOR_GROUP: number,
176176
/** Invalid topic (**17**) */
177177
ERR_TOPIC_EXCEPTION: number,

lib/error.js

Lines changed: 10 additions & 10 deletions
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.8.2 file src-cpp/rdkafkacpp.h ======
30+
// ====== Generated from librdkafka 1.9.2 file src-cpp/rdkafkacpp.h ======
3131
LibrdKafkaError.codes = {
3232

3333
/* Internal errors to rdkafka: */
@@ -50,15 +50,15 @@ LibrdKafkaError.codes = {
5050
/** Produced message timed out*/
5151
ERR__MSG_TIMED_OUT: -192,
5252
/** Reached the end of the topic+partition queue on
53-
* the broker. Not really an error.
54-
* This event is disabled by default,
55-
* see the `enable.partition.eof` configuration property. */
53+
* the broker. Not really an error.
54+
* This event is disabled by default,
55+
* see the `enable.partition.eof` configuration property. */
5656
ERR__PARTITION_EOF: -191,
5757
/** Permanent: Partition does not exist in cluster. */
5858
ERR__UNKNOWN_PARTITION: -190,
5959
/** File or filesystem error */
6060
ERR__FS: -189,
61-
/** Permanent: Topic does not exist in cluster. */
61+
/** Permanent: Topic does not exist in cluster. */
6262
ERR__UNKNOWN_TOPIC: -188,
6363
/** All broker connections are down. */
6464
ERR__ALL_BROKERS_DOWN: -187,
@@ -80,9 +80,9 @@ LibrdKafkaError.codes = {
8080
ERR__UNKNOWN_GROUP: -179,
8181
/** Operation in progress */
8282
ERR__IN_PROGRESS: -178,
83-
/** Previous operation in progress, wait for it to finish. */
83+
/** Previous operation in progress, wait for it to finish. */
8484
ERR__PREV_IN_PROGRESS: -177,
85-
/** This operation would interfere with an existing subscription */
85+
/** This operation would interfere with an existing subscription */
8686
ERR__EXISTING_SUBSCRIPTION: -176,
8787
/** Assigned partitions (rebalance_cb) */
8888
ERR__ASSIGN_PARTITIONS: -175,
@@ -193,15 +193,15 @@ LibrdKafkaError.codes = {
193193
ERR_NETWORK_EXCEPTION: 13,
194194
/** Coordinator load in progress */
195195
ERR_COORDINATOR_LOAD_IN_PROGRESS: 14,
196-
/** Group coordinator load in progress */
196+
/** Group coordinator load in progress */
197197
ERR_GROUP_LOAD_IN_PROGRESS: 14,
198198
/** Coordinator not available */
199199
ERR_COORDINATOR_NOT_AVAILABLE: 15,
200-
/** Group coordinator not available */
200+
/** Group coordinator not available */
201201
ERR_GROUP_COORDINATOR_NOT_AVAILABLE: 15,
202202
/** Not coordinator */
203203
ERR_NOT_COORDINATOR: 16,
204-
/** Not coordinator for group */
204+
/** Not coordinator for group */
205205
ERR_NOT_COORDINATOR_FOR_GROUP: 16,
206206
/** Invalid topic */
207207
ERR_TOPIC_EXCEPTION: 17,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "node-rdkafka",
33
"version": "v2.13.0",
44
"description": "Node.js bindings for librdkafka",
5-
"librdkafka": "1.8.2",
5+
"librdkafka": "1.9.2",
66
"main": "lib/index.js",
77
"scripts": {
88
"configure": "node-gyp configure",
@@ -46,4 +46,4 @@
4646
"engines": {
4747
"node": ">=6.0.0"
4848
}
49-
}
49+
}

0 commit comments

Comments
 (0)