@platformatic/rdkafka 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/bench/seed.sh +0 -0
- package/binding.gyp +8 -1
- package/ci/prepublish.js +0 -1
- package/config.d.ts +126 -10
- package/configure +0 -0
- package/deps/librdkafka/.semaphore/run-all-tests.yml +77 -0
- package/deps/librdkafka/.semaphore/semaphore-integration.yml +250 -0
- package/deps/librdkafka/.semaphore/semaphore.yml +67 -44
- package/deps/librdkafka/.semaphore/verify-linux-packages.yml +41 -0
- package/deps/librdkafka/CHANGELOG.md +471 -1
- package/deps/librdkafka/CONFIGURATION.md +29 -9
- package/deps/librdkafka/INTRODUCTION.md +909 -601
- package/deps/librdkafka/LICENSES.txt +592 -1
- package/deps/librdkafka/Makefile +2 -1
- package/deps/librdkafka/_mkltmpuuWEwa.c +13 -0
- package/deps/librdkafka/configure +0 -0
- package/deps/librdkafka/debian/rules +0 -0
- package/deps/librdkafka/dev-conf.sh +0 -0
- package/deps/librdkafka/examples/consumer.c +18 -8
- package/deps/librdkafka/examples/describe_consumer_groups.c +25 -6
- package/deps/librdkafka/examples/incremental_alter_configs.c +4 -5
- package/deps/librdkafka/examples/kafkatest_verifiable_client.cpp +26 -42
- package/deps/librdkafka/examples/openssl_engine_example.cpp +3 -4
- package/deps/librdkafka/examples/producer.cpp +2 -2
- package/deps/librdkafka/examples/user_scram.c +4 -5
- package/deps/librdkafka/examples/win_ssl_cert_store.cpp +4 -3
- package/deps/librdkafka/lds-gen.py +0 -0
- package/deps/librdkafka/mklove/Makefile.base +0 -0
- package/deps/librdkafka/packaging/RELEASE.md +8 -0
- package/deps/librdkafka/packaging/alpine/build-alpine.sh +0 -0
- package/deps/librdkafka/packaging/cp/README.md +4 -1
- package/deps/librdkafka/packaging/cp/check_features.c +12 -4
- package/deps/librdkafka/packaging/cp/verify-deb.sh +6 -6
- package/deps/librdkafka/packaging/cp/verify-packages.sh +52 -31
- package/deps/librdkafka/packaging/cp/verify-rpm.sh +6 -13
- package/deps/librdkafka/packaging/debian/rules +0 -0
- package/deps/librdkafka/packaging/get_version.py +0 -0
- package/deps/librdkafka/packaging/homebrew/brew-update-pr.sh +0 -0
- package/deps/librdkafka/packaging/mingw-w64/{travis-before-install.sh → export-variables.sh} +0 -7
- package/deps/librdkafka/packaging/mingw-w64/semaphoreci-build.sh +1 -1
- package/deps/librdkafka/packaging/nuget/artifact.py +0 -0
- package/deps/librdkafka/packaging/nuget/cleanup-s3.py +0 -0
- package/deps/librdkafka/packaging/nuget/nuget.sh +0 -0
- package/deps/librdkafka/packaging/nuget/packaging.py +0 -0
- package/deps/librdkafka/packaging/nuget/push-to-nuget.sh +0 -0
- package/deps/librdkafka/packaging/nuget/release.py +0 -0
- package/deps/librdkafka/packaging/nuget/requirements.txt +3 -3
- package/deps/librdkafka/packaging/rpm/mock-on-docker.sh +0 -0
- package/deps/librdkafka/packaging/rpm/tests/run-test.sh +0 -0
- package/deps/librdkafka/packaging/rpm/tests/test-on-docker.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-configurations-checks.sh +3 -1
- package/deps/librdkafka/packaging/tools/build-deb-package.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-debian.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-manylinux.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-release-artifacts.sh +0 -0
- package/deps/librdkafka/packaging/tools/distro-build.sh +0 -0
- package/deps/librdkafka/packaging/tools/gh-release-checksums.py +0 -0
- package/deps/librdkafka/packaging/tools/rdutcoverage.sh +0 -0
- package/deps/librdkafka/packaging/tools/run-in-docker.sh +28 -0
- package/deps/librdkafka/packaging/tools/run-integration-tests.sh +31 -0
- package/deps/librdkafka/packaging/tools/run-style-check.sh +4 -0
- package/deps/librdkafka/packaging/tools/style-format.sh +6 -5
- package/deps/librdkafka/packaging/tools/update_rpcs_max_versions.py +100 -0
- package/deps/librdkafka/service.yml +154 -0
- package/deps/librdkafka/src/generate_proto.sh +0 -0
- package/deps/librdkafka/src/rd.h +145 -2
- package/deps/librdkafka/src/rdaddr.h +6 -7
- package/deps/librdkafka/src/rdatomic.h +15 -11
- package/deps/librdkafka/src/rdavg.h +3 -2
- package/deps/librdkafka/src/rdbase64.c +33 -2
- package/deps/librdkafka/src/rdbase64.h +2 -0
- package/deps/librdkafka/src/rdendian.h +10 -9
- package/deps/librdkafka/src/rdhttp.c +418 -100
- package/deps/librdkafka/src/rdhttp.h +23 -5
- package/deps/librdkafka/src/rdkafka.c +299 -145
- package/deps/librdkafka/src/rdkafka.h +89 -6
- package/deps/librdkafka/src/rdkafka_admin.c +482 -105
- package/deps/librdkafka/src/rdkafka_admin.h +42 -0
- package/deps/librdkafka/src/rdkafka_broker.c +463 -312
- package/deps/librdkafka/src/rdkafka_broker.h +68 -10
- package/deps/librdkafka/src/rdkafka_buf.c +8 -5
- package/deps/librdkafka/src/rdkafka_buf.h +4 -3
- package/deps/librdkafka/src/rdkafka_cert.c +25 -1
- package/deps/librdkafka/src/rdkafka_cert.h +4 -3
- package/deps/librdkafka/src/rdkafka_cgrp.c +468 -143
- package/deps/librdkafka/src/rdkafka_cgrp.h +36 -2
- package/deps/librdkafka/src/rdkafka_conf.c +526 -102
- package/deps/librdkafka/src/rdkafka_conf.h +68 -4
- package/deps/librdkafka/src/rdkafka_feature.c +472 -35
- package/deps/librdkafka/src/rdkafka_feature.h +2 -0
- package/deps/librdkafka/src/rdkafka_fetcher.c +22 -2
- package/deps/librdkafka/src/rdkafka_fetcher.h +2 -2
- package/deps/librdkafka/src/rdkafka_int.h +84 -46
- package/deps/librdkafka/src/rdkafka_metadata.c +221 -136
- package/deps/librdkafka/src/rdkafka_metadata.h +15 -11
- package/deps/librdkafka/src/rdkafka_metadata_cache.c +279 -73
- package/deps/librdkafka/src/rdkafka_mock.c +795 -19
- package/deps/librdkafka/src/rdkafka_mock.h +119 -0
- package/deps/librdkafka/src/rdkafka_mock_cgrp.c +1298 -132
- package/deps/librdkafka/src/rdkafka_mock_handlers.c +345 -49
- package/deps/librdkafka/src/rdkafka_mock_int.h +180 -61
- package/deps/librdkafka/src/rdkafka_msg.c +35 -19
- package/deps/librdkafka/src/rdkafka_msg.h +3 -3
- package/deps/librdkafka/src/rdkafka_msgset_writer.c +14 -10
- package/deps/librdkafka/src/rdkafka_offset.c +33 -5
- package/deps/librdkafka/src/rdkafka_op.c +1 -1
- package/deps/librdkafka/src/rdkafka_op.h +45 -21
- package/deps/librdkafka/src/rdkafka_partition.c +118 -23
- package/deps/librdkafka/src/rdkafka_partition.h +16 -7
- package/deps/librdkafka/src/rdkafka_proto.h +4 -1
- package/deps/librdkafka/src/rdkafka_protocol.h +1 -0
- package/deps/librdkafka/src/rdkafka_queue.c +125 -48
- package/deps/librdkafka/src/rdkafka_queue.h +19 -0
- package/deps/librdkafka/src/rdkafka_range_assignor.c +1 -1
- package/deps/librdkafka/src/rdkafka_request.c +336 -64
- package/deps/librdkafka/src/rdkafka_request.h +24 -1
- package/deps/librdkafka/src/rdkafka_sasl.c +5 -3
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.c +14 -10
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c +1166 -89
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.h +13 -3
- package/deps/librdkafka/src/rdkafka_sasl_plain.c +3 -3
- package/deps/librdkafka/src/rdkafka_sasl_scram.c +4 -3
- package/deps/librdkafka/src/rdkafka_ssl.c +306 -81
- package/deps/librdkafka/src/rdkafka_ssl.h +22 -0
- package/deps/librdkafka/src/rdkafka_sticky_assignor.c +4 -0
- package/deps/librdkafka/src/rdkafka_telemetry.c +80 -23
- package/deps/librdkafka/src/rdkafka_telemetry_encode.c +5 -1
- package/deps/librdkafka/src/rdkafka_telemetry_encode.h +20 -20
- package/deps/librdkafka/src/rdkafka_topic.c +220 -137
- package/deps/librdkafka/src/rdkafka_topic.h +14 -8
- package/deps/librdkafka/src/rdkafka_transport.c +59 -47
- package/deps/librdkafka/src/rdkafka_transport.h +5 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.c +6 -1
- package/deps/librdkafka/src/rdmap.c +6 -1
- package/deps/librdkafka/src/rdrand.c +11 -1
- package/deps/librdkafka/src/rdtime.h +48 -17
- package/deps/librdkafka/src/rdunittest.c +42 -25
- package/deps/librdkafka/src/rdunittest.h +2 -0
- package/deps/librdkafka/src/rdwin32.h +1 -1
- package/deps/librdkafka/src/regexp.c +47 -42
- package/deps/librdkafka/src/tinycthread_extra.c +45 -21
- package/deps/librdkafka/src/tinycthread_extra.h +7 -3
- package/deps/librdkafka/src-cpp/rdkafkacpp.h +28 -2
- package/deps/librdkafka/tests/0001-multiobj.c +4 -0
- package/deps/librdkafka/tests/0004-conf.c +103 -36
- package/deps/librdkafka/tests/0009-mock_cluster.c +1 -0
- package/deps/librdkafka/tests/0011-produce_batch.c +2 -1
- package/deps/librdkafka/tests/0016-client_swname.c +18 -3
- package/deps/librdkafka/tests/0017-compression.c +6 -8
- package/deps/librdkafka/tests/0018-cgrp_term.c +8 -3
- package/deps/librdkafka/tests/0021-rkt_destroy.c +1 -0
- package/deps/librdkafka/tests/0022-consume_batch.c +4 -1
- package/deps/librdkafka/tests/0026-consume_pause.c +12 -14
- package/deps/librdkafka/tests/0028-long_topicnames.c +1 -1
- package/deps/librdkafka/tests/0029-assign_offset.c +6 -8
- package/deps/librdkafka/tests/0030-offset_commit.c +2 -2
- package/deps/librdkafka/tests/0033-regex_subscribe.c +33 -17
- package/deps/librdkafka/tests/0034-offset_reset.c +25 -4
- package/deps/librdkafka/tests/0036-partial_fetch.c +1 -0
- package/deps/librdkafka/tests/0038-performance.c +1 -0
- package/deps/librdkafka/tests/0040-io_event.c +11 -5
- package/deps/librdkafka/tests/0041-fetch_max_bytes.c +1 -0
- package/deps/librdkafka/tests/0044-partition_cnt.c +3 -2
- package/deps/librdkafka/tests/0045-subscribe_update.c +284 -20
- package/deps/librdkafka/tests/0047-partial_buf_tmout.c +1 -0
- package/deps/librdkafka/tests/0048-partitioner.c +1 -1
- package/deps/librdkafka/tests/0050-subscribe_adds.c +1 -0
- package/deps/librdkafka/tests/0051-assign_adds.c +1 -0
- package/deps/librdkafka/tests/0052-msg_timestamps.c +22 -4
- package/deps/librdkafka/tests/0053-stats_cb.cpp +12 -20
- package/deps/librdkafka/tests/0055-producer_latency.c +176 -3
- package/deps/librdkafka/tests/0056-balanced_group_mt.c +6 -2
- package/deps/librdkafka/tests/0058-log.cpp +3 -3
- package/deps/librdkafka/tests/0059-bsearch.cpp +8 -4
- package/deps/librdkafka/tests/0061-consumer_lag.cpp +25 -5
- package/deps/librdkafka/tests/0067-empty_topic.cpp +3 -0
- package/deps/librdkafka/tests/0068-produce_timeout.c +21 -23
- package/deps/librdkafka/tests/0069-consumer_add_parts.c +3 -7
- package/deps/librdkafka/tests/0075-retry.c +38 -1
- package/deps/librdkafka/tests/0076-produce_retry.c +2 -0
- package/deps/librdkafka/tests/0077-compaction.c +8 -2
- package/deps/librdkafka/tests/0080-admin_ut.c +34 -4
- package/deps/librdkafka/tests/0081-admin.c +455 -155
- package/deps/librdkafka/tests/0082-fetch_max_bytes.cpp +4 -0
- package/deps/librdkafka/tests/0083-cb_event.c +8 -3
- package/deps/librdkafka/tests/0084-destroy_flags.c +14 -18
- package/deps/librdkafka/tests/0085-headers.cpp +4 -0
- package/deps/librdkafka/tests/0086-purge.c +40 -7
- package/deps/librdkafka/tests/0088-produce_metadata_timeout.c +1 -1
- package/deps/librdkafka/tests/0089-max_poll_interval.c +12 -7
- package/deps/librdkafka/tests/0090-idempotence.c +1 -2
- package/deps/librdkafka/tests/0091-max_poll_interval_timeout.c +5 -7
- package/deps/librdkafka/tests/0092-mixed_msgver.c +6 -0
- package/deps/librdkafka/tests/0093-holb.c +8 -5
- package/deps/librdkafka/tests/0094-idempotence_msg_timeout.c +1 -0
- package/deps/librdkafka/tests/0097-ssl_verify.cpp +262 -70
- package/deps/librdkafka/tests/0098-consumer-txn.cpp +16 -16
- package/deps/librdkafka/tests/0099-commit_metadata.c +1 -1
- package/deps/librdkafka/tests/0101-fetch-from-follower.cpp +1 -1
- package/deps/librdkafka/tests/0102-static_group_rebalance.c +317 -16
- package/deps/librdkafka/tests/0103-transactions.c +7 -7
- package/deps/librdkafka/tests/0104-fetch_from_follower_mock.c +1 -0
- package/deps/librdkafka/tests/0105-transactions_mock.c +18 -11
- package/deps/librdkafka/tests/0106-cgrp_sess_timeout.c +35 -14
- package/deps/librdkafka/tests/0107-topic_recreate.c +2 -2
- package/deps/librdkafka/tests/0109-auto_create_topics.cpp +86 -26
- package/deps/librdkafka/tests/0110-batch_size.cpp +1 -2
- package/deps/librdkafka/tests/0112-assign_unknown_part.c +3 -14
- package/deps/librdkafka/tests/0113-cooperative_rebalance.cpp +248 -104
- package/deps/librdkafka/tests/0114-sticky_partitioning.cpp +3 -3
- package/deps/librdkafka/tests/0115-producer_auth.cpp +4 -1
- package/deps/librdkafka/tests/0116-kafkaconsumer_close.cpp +7 -5
- package/deps/librdkafka/tests/0117-mock_errors.c +15 -5
- package/deps/librdkafka/tests/0118-commit_rebalance.c +41 -8
- package/deps/librdkafka/tests/0119-consumer_auth.cpp +20 -1
- package/deps/librdkafka/tests/0120-asymmetric_subscription.c +8 -3
- package/deps/librdkafka/tests/0125-immediate_flush.c +1 -1
- package/deps/librdkafka/tests/0126-oauthbearer_oidc.c +323 -8
- package/deps/librdkafka/tests/0129-fetch_aborted_msgs.c +1 -0
- package/deps/librdkafka/tests/0132-strategy_ordering.c +12 -4
- package/deps/librdkafka/tests/0133-ssl_keys.c +28 -6
- package/deps/librdkafka/tests/0137-barrier_batch_consume.c +24 -14
- package/deps/librdkafka/tests/0139-offset_validation_mock.c +510 -2
- package/deps/librdkafka/tests/0140-commit_metadata.cpp +1 -1
- package/deps/librdkafka/tests/0142-reauthentication.c +37 -17
- package/deps/librdkafka/tests/0143-exponential_backoff_mock.c +39 -40
- package/deps/librdkafka/tests/0146-metadata_mock.c +76 -15
- package/deps/librdkafka/tests/0147-consumer_group_consumer_mock.c +952 -0
- package/deps/librdkafka/tests/0148-offset_fetch_commit_error_mock.c +563 -0
- package/deps/librdkafka/tests/0149-broker-same-host-port.c +140 -0
- package/deps/librdkafka/tests/0150-telemetry_mock.c +9 -6
- package/deps/librdkafka/tests/0151-purge-brokers.c +566 -0
- package/deps/librdkafka/tests/0152-rebootstrap.c +59 -0
- package/deps/librdkafka/tests/0153-memberid.c +128 -0
- package/deps/librdkafka/tests/CMakeLists.txt +6 -0
- package/deps/librdkafka/tests/LibrdkafkaTestApp.py +34 -9
- package/deps/librdkafka/tests/autotest.sh +0 -0
- package/deps/librdkafka/tests/broker_version_tests.py +0 -0
- package/deps/librdkafka/tests/buildbox.sh +0 -0
- package/deps/librdkafka/tests/cleanup-checker-tests.sh +0 -0
- package/deps/librdkafka/tests/cluster_testing.py +0 -0
- package/deps/librdkafka/tests/delete-test-topics.sh +0 -0
- package/deps/librdkafka/tests/fixtures/oauthbearer/jwt_assertion_template.json +10 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.intermediate.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.intermediate.pem +72 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.pem +42 -101
- package/deps/librdkafka/tests/fixtures/ssl/client2.intermediate.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.key +41 -29
- package/deps/librdkafka/tests/fixtures/ssl/create_keys.sh +112 -37
- package/deps/librdkafka/tests/gen-ssl-certs.sh +0 -0
- package/deps/librdkafka/tests/interactive_broker_version.py +0 -0
- package/deps/librdkafka/tests/java/Makefile +2 -1
- package/deps/librdkafka/tests/java/run-class.sh +0 -0
- package/deps/librdkafka/tests/lz4_manual_test.sh +0 -0
- package/deps/librdkafka/tests/multi-broker-version-test.sh +0 -0
- package/deps/librdkafka/tests/parse-refcnt.sh +0 -0
- package/deps/librdkafka/tests/performance_plot.py +0 -0
- package/deps/librdkafka/tests/requirements.txt +1 -1
- package/deps/librdkafka/tests/run-all-tests.sh +79 -0
- package/deps/librdkafka/tests/run-consumer-tests.sh +0 -0
- package/deps/librdkafka/tests/run-producer-tests.sh +0 -0
- package/deps/librdkafka/tests/run-test-batches.py +157 -0
- package/deps/librdkafka/tests/run-test.sh +0 -0
- package/deps/librdkafka/tests/sasl_test.py +0 -0
- package/deps/librdkafka/tests/test.c +478 -18
- package/deps/librdkafka/tests/test.h +62 -13
- package/deps/librdkafka/tests/testcpp.cpp +6 -1
- package/deps/librdkafka/tests/testcpp.h +30 -2
- package/deps/librdkafka/tests/testshared.h +16 -2
- package/deps/librdkafka/tests/tools/stats/graph.py +0 -0
- package/deps/librdkafka/tests/tools/stats/to_csv.py +1 -1
- package/deps/librdkafka/tests/trivup/trivup-0.14.0.tar.gz +0 -0
- package/deps/librdkafka/tests/until-fail.sh +0 -0
- package/deps/librdkafka/tests/xxxx-metadata.cpp +1 -1
- package/deps/librdkafka/vcpkg.json +1 -1
- package/deps/librdkafka/win32/setup-msys2.ps1 +24 -8
- package/deps/librdkafka/win32/setup-vcpkg.ps1 +28 -6
- package/deps/librdkafka/win32/tests/tests.vcxproj +6 -0
- package/deps/librdkafka/win32/wingetopt.h +5 -4
- package/errors.d.ts +27 -1
- package/lib/error.js +29 -3
- package/make_docs.sh +0 -0
- package/package.json +11 -11
- package/run_docker.sh +0 -0
- package/src/callbacks.cc +6 -9
- package/src/callbacks.h +1 -5
- package/test/kafka-consumer-worker.js +10 -7
- package/test/kafka-consumer.spec.js +32 -21
- package/ci/update-version.js +0 -123
- package/deps/librdkafka/.semaphore/project.yml +0 -43
- package/deps/librdkafka/.semaphore/project_public.yml +0 -20
- package/deps/librdkafka/win32/install-openssl.ps1 +0 -33
|
@@ -244,22 +244,22 @@ static RD_INLINE RD_UNUSED void rtrim(char *str) {
|
|
|
244
244
|
if (test_needs_auth()) { \
|
|
245
245
|
TEST_SKIP("Mock cluster does not support SSL/SASL\n"); \
|
|
246
246
|
return RET; \
|
|
247
|
-
} \
|
|
248
|
-
if (test_consumer_group_protocol() && \
|
|
249
|
-
strcmp(test_consumer_group_protocol(), "classic")) { \
|
|
250
|
-
TEST_SKIP( \
|
|
251
|
-
"Mock cluster cannot be used " \
|
|
252
|
-
"with group.protocol=%s\n", \
|
|
253
|
-
test_consumer_group_protocol()); \
|
|
254
|
-
return RET; \
|
|
255
247
|
}
|
|
256
248
|
|
|
257
|
-
|
|
258
249
|
void test_conf_init(rd_kafka_conf_t **conf,
|
|
259
250
|
rd_kafka_topic_conf_t **topic_conf,
|
|
260
251
|
int timeout);
|
|
261
252
|
|
|
262
253
|
|
|
254
|
+
typedef struct test_conf_log_interceptor_s test_conf_log_interceptor_t;
|
|
255
|
+
|
|
256
|
+
test_conf_log_interceptor_t *
|
|
257
|
+
test_conf_set_log_interceptor(rd_kafka_conf_t *conf,
|
|
258
|
+
void (*log_cb)(const rd_kafka_t *rk,
|
|
259
|
+
int level,
|
|
260
|
+
const char *fac,
|
|
261
|
+
const char *buf),
|
|
262
|
+
const char **debug_contexts);
|
|
263
263
|
|
|
264
264
|
void test_msg_fmt(char *dest,
|
|
265
265
|
size_t dest_size,
|
|
@@ -323,7 +323,7 @@ struct test_msgver_s {
|
|
|
323
323
|
|
|
324
324
|
const char *msgid_hdr; /**< msgid string is in header by this name,
|
|
325
325
|
* rather than in the payload (default). */
|
|
326
|
-
};
|
|
326
|
+
}; /* test_msgver_t; */
|
|
327
327
|
|
|
328
328
|
/* Message */
|
|
329
329
|
struct test_mv_m {
|
|
@@ -592,6 +592,8 @@ void test_verify_rkmessage0(const char *func,
|
|
|
592
592
|
|
|
593
593
|
void test_consumer_subscribe(rd_kafka_t *rk, const char *topic);
|
|
594
594
|
|
|
595
|
+
void test_consumer_subscribe_multi(rd_kafka_t *rk, int topic_count, ...);
|
|
596
|
+
|
|
595
597
|
void test_consume_msgs_easy_mv0(const char *group_id,
|
|
596
598
|
const char *topic,
|
|
597
599
|
rd_bool_t txn,
|
|
@@ -674,6 +676,29 @@ void test_consumer_verify_assignment0(const char *func,
|
|
|
674
676
|
test_consumer_verify_assignment0(__FUNCTION__, __LINE__, rk, \
|
|
675
677
|
fail_immediately, __VA_ARGS__)
|
|
676
678
|
|
|
679
|
+
rd_bool_t test_consumer_verify_assignment_topic_partition_list0(
|
|
680
|
+
const char *func,
|
|
681
|
+
int line,
|
|
682
|
+
rd_kafka_t *rk,
|
|
683
|
+
const rd_kafka_topic_partition_list_t *expected_assignment);
|
|
684
|
+
#define test_consumer_verify_assignment_topic_partition_list( \
|
|
685
|
+
rk, expected_assignment) \
|
|
686
|
+
test_consumer_verify_assignment_topic_partition_list0( \
|
|
687
|
+
__FUNCTION__, __LINE__, rk, expected_assignment)
|
|
688
|
+
|
|
689
|
+
void test_consumer_wait_assignment_topic_partition_list0(
|
|
690
|
+
const char *func,
|
|
691
|
+
int line,
|
|
692
|
+
rd_kafka_t *rk,
|
|
693
|
+
rd_bool_t do_poll,
|
|
694
|
+
const rd_kafka_topic_partition_list_t *expected_assignment,
|
|
695
|
+
int timeout_ms);
|
|
696
|
+
#define test_consumer_wait_assignment_topic_partition_list( \
|
|
697
|
+
rk, do_poll, expected_assignment, timeout_ms) \
|
|
698
|
+
test_consumer_wait_assignment_topic_partition_list0( \
|
|
699
|
+
__FUNCTION__, __LINE__, rk, do_poll, expected_assignment, \
|
|
700
|
+
timeout_ms)
|
|
701
|
+
|
|
677
702
|
void test_consumer_assign(const char *what,
|
|
678
703
|
rd_kafka_t *rk,
|
|
679
704
|
rd_kafka_topic_partition_list_t *parts);
|
|
@@ -684,6 +709,14 @@ void test_consumer_unassign(const char *what, rd_kafka_t *rk);
|
|
|
684
709
|
void test_consumer_incremental_unassign(const char *what,
|
|
685
710
|
rd_kafka_t *rk,
|
|
686
711
|
rd_kafka_topic_partition_list_t *parts);
|
|
712
|
+
void test_consumer_assign_by_rebalance_protocol(
|
|
713
|
+
const char *what,
|
|
714
|
+
rd_kafka_t *rk,
|
|
715
|
+
rd_kafka_topic_partition_list_t *parts);
|
|
716
|
+
void test_consumer_unassign_by_rebalance_protocol(
|
|
717
|
+
const char *what,
|
|
718
|
+
rd_kafka_t *rk,
|
|
719
|
+
rd_kafka_topic_partition_list_t *parts);
|
|
687
720
|
void test_consumer_assign_partition(const char *what,
|
|
688
721
|
rd_kafka_t *rk,
|
|
689
722
|
const char *topic,
|
|
@@ -698,6 +731,7 @@ void test_consumer_close(rd_kafka_t *rk);
|
|
|
698
731
|
|
|
699
732
|
void test_flush(rd_kafka_t *rk, int timeout_ms);
|
|
700
733
|
|
|
734
|
+
int test_is_forbidden_conf_group_protocol_consumer(const char *name);
|
|
701
735
|
void test_conf_set(rd_kafka_conf_t *conf, const char *name, const char *val);
|
|
702
736
|
char *test_topic_conf_get(const rd_kafka_topic_conf_t *tconf, const char *name);
|
|
703
737
|
int test_conf_match(rd_kafka_conf_t *conf, const char *name, const char *val);
|
|
@@ -709,6 +743,7 @@ void test_any_conf_set(rd_kafka_conf_t *conf,
|
|
|
709
743
|
const char *name,
|
|
710
744
|
const char *val);
|
|
711
745
|
|
|
746
|
+
rd_kafka_topic_partition_list_t *test_topic_partitions(int cnt, ...);
|
|
712
747
|
void test_print_partition_list(
|
|
713
748
|
const rd_kafka_topic_partition_list_t *partitions);
|
|
714
749
|
int test_partition_list_cmp(rd_kafka_topic_partition_list_t *al,
|
|
@@ -726,6 +761,11 @@ void test_create_topic(rd_kafka_t *use_rk,
|
|
|
726
761
|
const char *topicname,
|
|
727
762
|
int partition_cnt,
|
|
728
763
|
int replication_factor);
|
|
764
|
+
void test_create_topic_wait_exists(rd_kafka_t *use_rk,
|
|
765
|
+
const char *topicname,
|
|
766
|
+
int partition_cnt,
|
|
767
|
+
int replication_factor,
|
|
768
|
+
int timeout);
|
|
729
769
|
rd_kafka_resp_err_t test_auto_create_topic_rkt(rd_kafka_t *rk,
|
|
730
770
|
rd_kafka_topic_t *rkt,
|
|
731
771
|
int timeout_ms);
|
|
@@ -760,6 +800,7 @@ void test_prepare_msg(uint64_t testid,
|
|
|
760
800
|
|
|
761
801
|
#if WITH_SOCKEM
|
|
762
802
|
void test_socket_enable(rd_kafka_conf_t *conf);
|
|
803
|
+
void *test_socket_find(struct test *test, sockem_t *skm);
|
|
763
804
|
void test_socket_close_all(struct test *test, int reinit);
|
|
764
805
|
int test_socket_sockem_set_all(const char *key, int val);
|
|
765
806
|
void test_socket_sockem_set(int s, const char *key, int value);
|
|
@@ -859,6 +900,12 @@ rd_kafka_resp_err_t test_delete_all_test_topics(int timeout_ms);
|
|
|
859
900
|
void test_mock_cluster_destroy(rd_kafka_mock_cluster_t *mcluster);
|
|
860
901
|
rd_kafka_mock_cluster_t *test_mock_cluster_new(int broker_cnt,
|
|
861
902
|
const char **bootstraps);
|
|
903
|
+
|
|
904
|
+
size_t test_mock_get_matching_request_cnt(
|
|
905
|
+
rd_kafka_mock_cluster_t *mcluster,
|
|
906
|
+
rd_bool_t (*match)(rd_kafka_mock_request_t *request, void *opaque),
|
|
907
|
+
void *opaque);
|
|
908
|
+
|
|
862
909
|
size_t test_mock_wait_matching_requests(
|
|
863
910
|
rd_kafka_mock_cluster_t *mcluster,
|
|
864
911
|
size_t num,
|
|
@@ -866,6 +913,10 @@ size_t test_mock_wait_matching_requests(
|
|
|
866
913
|
rd_bool_t (*match)(rd_kafka_mock_request_t *request, void *opaque),
|
|
867
914
|
void *opaque);
|
|
868
915
|
|
|
916
|
+
void test_mock_cluster_member_assignment(rd_kafka_mock_cluster_t *mcluster,
|
|
917
|
+
int member_cnt,
|
|
918
|
+
...);
|
|
919
|
+
|
|
869
920
|
int test_error_is_not_fatal_cb(rd_kafka_t *rk,
|
|
870
921
|
rd_kafka_resp_err_t err,
|
|
871
922
|
const char *reason);
|
|
@@ -873,9 +924,7 @@ int test_error_is_not_fatal_cb(rd_kafka_t *rk,
|
|
|
873
924
|
|
|
874
925
|
const char *test_consumer_group_protocol();
|
|
875
926
|
|
|
876
|
-
int
|
|
877
|
-
|
|
878
|
-
int test_consumer_group_protocol_consumer();
|
|
927
|
+
int test_consumer_group_protocol_classic();
|
|
879
928
|
|
|
880
929
|
/**
|
|
881
930
|
* @brief Calls rdkafka function (with arguments)
|
|
@@ -87,7 +87,7 @@ static int read_config_file(std::string path,
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
void conf_init(RdKafka::Conf **conf, RdKafka::Conf **topic_conf, int timeout) {
|
|
90
|
-
const char *tmp;
|
|
90
|
+
const char *tmp, *group_protocol;
|
|
91
91
|
|
|
92
92
|
if (conf)
|
|
93
93
|
*conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL);
|
|
@@ -107,6 +107,11 @@ void conf_init(RdKafka::Conf **conf, RdKafka::Conf **topic_conf, int timeout) {
|
|
|
107
107
|
Test::Fail("TEST_DEBUG failed: " + errstr);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
if (*conf && (group_protocol = test_consumer_group_protocol())) {
|
|
111
|
+
if ((*conf)->set("group.protocol", group_protocol, errstr) !=
|
|
112
|
+
RdKafka::Conf::CONF_OK)
|
|
113
|
+
Test::Fail("set group.protocol failed: " + errstr);
|
|
114
|
+
}
|
|
110
115
|
|
|
111
116
|
if (timeout)
|
|
112
117
|
test_timeout_set(timeout);
|
|
@@ -131,6 +131,21 @@ static RD_UNUSED void create_topic(RdKafka::Handle *use_handle,
|
|
|
131
131
|
test_create_topic(use_rk, topicname, partition_cnt, replication_factor);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
/**
|
|
135
|
+
* @brief Create a topic and wait for it to be available in metadata.
|
|
136
|
+
*/
|
|
137
|
+
static RD_UNUSED void create_topic_wait_exists(RdKafka::Handle *use_handle,
|
|
138
|
+
const char *topicname,
|
|
139
|
+
int partition_cnt,
|
|
140
|
+
int replication_factor,
|
|
141
|
+
int timeout) {
|
|
142
|
+
rd_kafka_t *use_rk = NULL;
|
|
143
|
+
if (use_handle != NULL)
|
|
144
|
+
use_rk = use_handle->c_ptr();
|
|
145
|
+
test_create_topic_wait_exists(use_rk, topicname, partition_cnt,
|
|
146
|
+
replication_factor, timeout);
|
|
147
|
+
}
|
|
148
|
+
|
|
134
149
|
/**
|
|
135
150
|
* @brief Delete a topic
|
|
136
151
|
*/
|
|
@@ -142,6 +157,14 @@ static RD_UNUSED void delete_topic(RdKafka::Handle *use_handle,
|
|
|
142
157
|
test_delete_topic(use_rk, topicname);
|
|
143
158
|
}
|
|
144
159
|
|
|
160
|
+
/**
|
|
161
|
+
* @brief
|
|
162
|
+
*/
|
|
163
|
+
static RD_UNUSED bool is_forbidden_conf_group_protocol_consumer(
|
|
164
|
+
const std::string &name) {
|
|
165
|
+
return test_is_forbidden_conf_group_protocol_consumer(name.c_str());
|
|
166
|
+
}
|
|
167
|
+
|
|
145
168
|
/**
|
|
146
169
|
* @brief Get new configuration objects
|
|
147
170
|
*/
|
|
@@ -152,6 +175,11 @@ static RD_UNUSED void conf_set(RdKafka::Conf *conf,
|
|
|
152
175
|
std::string name,
|
|
153
176
|
std::string val) {
|
|
154
177
|
std::string errstr;
|
|
178
|
+
if (Test::is_forbidden_conf_group_protocol_consumer(name)) {
|
|
179
|
+
Test::Say(tostr() << "Skipping setting forbidden configuration " << name
|
|
180
|
+
<< " for CONSUMER protocol.\n");
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
155
183
|
if (conf->set(name, val, errstr) != RdKafka::Conf::CONF_OK)
|
|
156
184
|
Test::Fail("Conf failed: " + errstr);
|
|
157
185
|
}
|
|
@@ -163,8 +191,8 @@ static RD_UNUSED void print_TopicPartitions(
|
|
|
163
191
|
<< " TopicPartition(s):\n");
|
|
164
192
|
for (unsigned int i = 0; i < partitions.size(); i++)
|
|
165
193
|
Test::Say(tostr() << " " << partitions[i]->topic() << "["
|
|
166
|
-
<< partitions[i]->partition() << "] "
|
|
167
|
-
<<
|
|
194
|
+
<< partitions[i]->partition() << "] " << "offset "
|
|
195
|
+
<< partitions[i]->offset() << ": "
|
|
168
196
|
<< RdKafka::err2str(partitions[i]->err()) << "\n");
|
|
169
197
|
}
|
|
170
198
|
|
|
@@ -62,7 +62,7 @@ extern int test_quick;
|
|
|
62
62
|
/** @brief Broker version to int */
|
|
63
63
|
#define TEST_BRKVER(A, B, C, D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D))
|
|
64
64
|
/** @brief return single version component from int */
|
|
65
|
-
#define TEST_BRKVER_X(V, I) (((V) >> (24 - ((I)*8))) & 0xff)
|
|
65
|
+
#define TEST_BRKVER_X(V, I) (((V) >> (24 - ((I) * 8))) & 0xff)
|
|
66
66
|
|
|
67
67
|
/** @brief Topic Admin API supported by this broker version and later */
|
|
68
68
|
#define TEST_BRKVER_TOPIC_ADMINAPI TEST_BRKVER(0, 10, 2, 0)
|
|
@@ -79,6 +79,12 @@ void test_create_topic(rd_kafka_t *use_rk,
|
|
|
79
79
|
int partition_cnt,
|
|
80
80
|
int replication_factor);
|
|
81
81
|
|
|
82
|
+
void test_create_topic_wait_exists(rd_kafka_t *use_rk,
|
|
83
|
+
const char *topicname,
|
|
84
|
+
int partition_cnt,
|
|
85
|
+
int replication_factor,
|
|
86
|
+
int timeout);
|
|
87
|
+
|
|
82
88
|
void test_create_partitions(rd_kafka_t *use_rk,
|
|
83
89
|
const char *topicname,
|
|
84
90
|
int new_partition_cnt);
|
|
@@ -179,10 +185,12 @@ void test_SAY(const char *file, int line, int level, const char *str);
|
|
|
179
185
|
void test_SKIP(const char *file, int line, const char *str);
|
|
180
186
|
|
|
181
187
|
void test_timeout_set(int timeout);
|
|
188
|
+
int test_is_forbidden_conf_group_protocol_consumer(const char *name);
|
|
182
189
|
int test_set_special_conf(const char *name, const char *val, int *timeoutp);
|
|
183
190
|
char *test_conf_get(const rd_kafka_conf_t *conf, const char *name);
|
|
184
191
|
const char *test_conf_get_path(void);
|
|
185
192
|
const char *test_getenv(const char *env, const char *def);
|
|
193
|
+
size_t test_read_file(const char *path, char *dst, size_t dst_size);
|
|
186
194
|
|
|
187
195
|
int test_needs_auth(void);
|
|
188
196
|
|
|
@@ -386,7 +394,7 @@ void test_sub_skip(const char *fmt, ...) RD_FORMAT(printf, 1, 2);
|
|
|
386
394
|
#ifndef _WIN32
|
|
387
395
|
#define rd_sleep(S) sleep(S)
|
|
388
396
|
#else
|
|
389
|
-
#define rd_sleep(S) Sleep((S)*1000)
|
|
397
|
+
#define rd_sleep(S) Sleep((S) * 1000)
|
|
390
398
|
#endif
|
|
391
399
|
|
|
392
400
|
/* Make sure __SANITIZE_ADDRESS__ (gcc) is defined if compiled with asan */
|
|
@@ -399,4 +407,10 @@ void test_sub_skip(const char *fmt, ...) RD_FORMAT(printf, 1, 2);
|
|
|
399
407
|
|
|
400
408
|
int test_run_java(const char *cls, const char **argv);
|
|
401
409
|
int test_waitpid(int pid);
|
|
410
|
+
|
|
411
|
+
const char *test_consumer_group_protocol();
|
|
412
|
+
|
|
413
|
+
int test_consumer_group_protocol_classic();
|
|
414
|
+
|
|
415
|
+
|
|
402
416
|
#endif /* _TESTSHARED_H_ */
|
|
File without changes
|
|
@@ -115,7 +115,7 @@ for linenr, string in enumerate(sys.stdin):
|
|
|
115
115
|
try:
|
|
116
116
|
top, brokers, topics, toppars = parse(linenr, string)
|
|
117
117
|
except Exception as e:
|
|
118
|
-
print(f"SKIP {linenr+1}: {e}")
|
|
118
|
+
print(f"SKIP {linenr + 1}: {e}")
|
|
119
119
|
continue
|
|
120
120
|
|
|
121
121
|
w_top.write_list(top)
|
|
Binary file
|
|
File without changes
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# Install (if necessary) and set up msys2.
|
|
2
|
+
$ErrorActionPreference = "Stop"
|
|
2
3
|
|
|
4
|
+
$url="https://github.com/msys2/msys2-installer/releases/download/2025-06-22/msys2-base-x86_64-20250622.sfx.exe"
|
|
5
|
+
$sha256="df6c053891d0b87c9104c118c0ce22885c3bc350a7659958d6d97a6760ccfa76"
|
|
6
|
+
$cacheKey = "msys2-$sha256-$Env:CACHE_TAG"
|
|
7
|
+
$librdkafkaPath = Get-Location;
|
|
3
8
|
|
|
4
|
-
|
|
5
|
-
$
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
try {
|
|
10
|
+
cache restore $cacheKey
|
|
11
|
+
} catch {
|
|
12
|
+
echo "cache command not found"
|
|
13
|
+
}
|
|
8
14
|
if (!(Test-Path -Path "c:\msys64\usr\bin\bash.exe")) {
|
|
9
15
|
echo "Downloading and installing msys2 to c:\msys64"
|
|
10
16
|
|
|
@@ -22,10 +28,20 @@ if (!(Test-Path -Path "c:\msys64\usr\bin\bash.exe")) {
|
|
|
22
28
|
echo "Setting up msys"
|
|
23
29
|
c:\msys64\usr\bin\bash -lc ' '
|
|
24
30
|
|
|
31
|
+
# Update packages
|
|
32
|
+
echo "Updating msys2 packages"
|
|
33
|
+
c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu --overwrite '*'"
|
|
34
|
+
# Update pacman"
|
|
35
|
+
c:\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm pacman"
|
|
36
|
+
# Install needed packages"
|
|
37
|
+
c:\msys64\usr\bin\bash -lc "pacman --sync --noconfirm --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-openssl mingw-w64-x86_64-lz4 mingw-w64-x86_64-zstd"
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
powershell -command "cd $librdkafkaPath; cache store $cacheKey c:\msys64"
|
|
41
|
+
} catch {
|
|
42
|
+
echo "cache command not found"
|
|
43
|
+
}
|
|
44
|
+
|
|
25
45
|
} else {
|
|
26
46
|
echo "Using previously installed msys2"
|
|
27
47
|
}
|
|
28
|
-
|
|
29
|
-
# Update packages
|
|
30
|
-
echo "Updating msys2 packages"
|
|
31
|
-
c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu --overwrite '*'"
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
# Set up vcpkg and install required packages.
|
|
2
|
+
$version = "2025.07.25"
|
|
3
|
+
$vpkgHash=(Get-FileHash ".\librdkafka\vcpkg.json").Hash
|
|
4
|
+
$cacheKey = "vcpkg-$version-$Env:triplet-$vpkgHash-$Env:CACHE_TAG"
|
|
5
|
+
$librdkafkaPath = ".\librdkafka";
|
|
2
6
|
|
|
7
|
+
try {
|
|
8
|
+
cache restore $cacheKey
|
|
9
|
+
} catch {
|
|
10
|
+
echo "cache command not found"
|
|
11
|
+
}
|
|
3
12
|
if (!(Test-Path -Path vcpkg/.git)) {
|
|
4
13
|
git clone https://github.com/Microsoft/vcpkg.git
|
|
14
|
+
cd vcpkg
|
|
15
|
+
git checkout $version
|
|
16
|
+
.\bootstrap-vcpkg.bat
|
|
17
|
+
cd ..
|
|
18
|
+
cd librdkafka
|
|
19
|
+
..\vcpkg\vcpkg integrate install
|
|
20
|
+
# Install required packages.
|
|
21
|
+
..\vcpkg\vcpkg --feature-flags=versions install --triplet $Env:triplet
|
|
22
|
+
cd ..
|
|
23
|
+
try {
|
|
24
|
+
cache store $cacheKey .\vcpkg
|
|
25
|
+
} catch {
|
|
26
|
+
echo "cache command not found"
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
cd librdkafka
|
|
30
|
+
..\vcpkg\vcpkg integrate install
|
|
31
|
+
cd ..
|
|
32
|
+
echo "Using previously installed vcpkg"
|
|
5
33
|
}
|
|
6
34
|
|
|
7
|
-
cd vcpkg
|
|
8
|
-
git checkout 2024.09.30
|
|
9
|
-
cd ..
|
|
10
|
-
|
|
11
|
-
.\vcpkg\bootstrap-vcpkg.bat
|
|
12
|
-
|
|
@@ -227,7 +227,13 @@
|
|
|
227
227
|
<ClCompile Include="..\..\tests\0144-idempotence_mock.c" />
|
|
228
228
|
<ClCompile Include="..\..\tests\0145-pause_resume_mock.c" />
|
|
229
229
|
<ClCompile Include="..\..\tests\0146-metadata_mock.c" />
|
|
230
|
+
<ClCompile Include="..\..\tests\0147-consumer_group_consumer_mock.c" />
|
|
231
|
+
<ClCompile Include="..\..\tests\0148-offset_fetch_commit_error_mock.c" />
|
|
232
|
+
<ClCompile Include="..\..\tests\0149-broker-same-host-port.c" />
|
|
230
233
|
<ClCompile Include="..\..\tests\0150-telemetry_mock.c" />
|
|
234
|
+
<ClCompile Include="..\..\tests\0151-purge-brokers.c" />
|
|
235
|
+
<ClCompile Include="..\..\tests\0152-rebootstrap.c" />
|
|
236
|
+
<ClCompile Include="..\..\tests\0153-memberid.c" />
|
|
231
237
|
<ClCompile Include="..\..\tests\8000-idle.cpp" />
|
|
232
238
|
<ClCompile Include="..\..\tests\8001-fetch_from_follower_mock_manual.c" />
|
|
233
239
|
<ClCompile Include="..\..\tests\test.c" />
|
|
@@ -67,10 +67,11 @@ struct option /* specification for a long form option... */
|
|
|
67
67
|
int val; /* its associated status value */
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
enum
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
enum /* permitted values for its `has_arg' field... */
|
|
71
|
+
{
|
|
72
|
+
no_argument = 0, /* option never takes an argument */
|
|
73
|
+
required_argument, /* option always requires an argument */
|
|
74
|
+
optional_argument /* option may take an argument */
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
extern int getopt_long(int nargc,
|
package/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ====== Generated from librdkafka 2.
|
|
1
|
+
// ====== Generated from librdkafka 2.12.0 file src-cpp/rdkafkacpp.h ======
|
|
2
2
|
export const CODES: { ERRORS: {
|
|
3
3
|
/* Internal errors to rdkafka: */
|
|
4
4
|
/** Begin internal error codes (**-200**) */
|
|
@@ -128,6 +128,11 @@ export const CODES: { ERRORS: {
|
|
|
128
128
|
ERR__AUTO_OFFSET_RESET: number,
|
|
129
129
|
/** Partition log truncation detected (**-139**) */
|
|
130
130
|
ERR__LOG_TRUNCATION: number,
|
|
131
|
+
/** A different record in the batch was invalid
|
|
132
|
+
* and this message failed persisting (**-138**) */
|
|
133
|
+
ERR__INVALID_DIFFERENT_RECORD: number,
|
|
134
|
+
/** Broker is going away but client isn't terminating (**-137**) */
|
|
135
|
+
ERR__DESTROY_BROKER: number,
|
|
131
136
|
/** End internal error codes (**-100**) */
|
|
132
137
|
ERR__END: number,
|
|
133
138
|
/* Kafka broker errors: */
|
|
@@ -344,4 +349,25 @@ export const CODES: { ERRORS: {
|
|
|
344
349
|
ERR_FEATURE_UPDATE_FAILED: number,
|
|
345
350
|
/** Request principal deserialization failed during forwarding (**97**) */
|
|
346
351
|
ERR_PRINCIPAL_DESERIALIZATION_FAILURE: number,
|
|
352
|
+
/** Unknown Topic Id (**100**) */
|
|
353
|
+
ERR_UNKNOWN_TOPIC_ID: number,
|
|
354
|
+
/** The member epoch is fenced by the group coordinator (**110**) */
|
|
355
|
+
ERR_FENCED_MEMBER_EPOCH: number,
|
|
356
|
+
/** The instance ID is still used by another member in the
|
|
357
|
+
* consumer group (**111**) */
|
|
358
|
+
ERR_UNRELEASED_INSTANCE_ID: number,
|
|
359
|
+
/** The assignor or its version range is not supported by the consumer
|
|
360
|
+
* group (**112**) */
|
|
361
|
+
ERR_UNSUPPORTED_ASSIGNOR: number,
|
|
362
|
+
/** The member epoch is stale (**113**) */
|
|
363
|
+
ERR_STALE_MEMBER_EPOCH: number,
|
|
364
|
+
/** Client sent a push telemetry request with an invalid or outdated
|
|
365
|
+
* subscription ID (**117**) */
|
|
366
|
+
ERR_UNKNOWN_SUBSCRIPTION_ID: number,
|
|
367
|
+
/** Client sent a push telemetry request larger than the maximum size
|
|
368
|
+
* the broker will accept (**118**) */
|
|
369
|
+
ERR_TELEMETRY_TOO_LARGE: number,
|
|
370
|
+
/** Client metadata is stale,
|
|
371
|
+
* client should rebootstrap to obtain new metadata (**129**) */
|
|
372
|
+
ERR_REBOOTSTRAP_REQUIRED: number,
|
|
347
373
|
}}
|
package/lib/error.js
CHANGED
|
@@ -27,7 +27,7 @@ LibrdKafkaError.wrap = errorWrap;
|
|
|
27
27
|
* @enum {number}
|
|
28
28
|
* @constant
|
|
29
29
|
*/
|
|
30
|
-
// ====== Generated from librdkafka 2.
|
|
30
|
+
// ====== Generated from librdkafka 2.12.0 file src-cpp/rdkafkacpp.h ======
|
|
31
31
|
LibrdKafkaError.codes = {
|
|
32
32
|
|
|
33
33
|
/* Internal errors to rdkafka: */
|
|
@@ -158,6 +158,11 @@ LibrdKafkaError.codes = {
|
|
|
158
158
|
ERR__AUTO_OFFSET_RESET: -140,
|
|
159
159
|
/** Partition log truncation detected */
|
|
160
160
|
ERR__LOG_TRUNCATION: -139,
|
|
161
|
+
/** A different record in the batch was invalid
|
|
162
|
+
* and this message failed persisting. */
|
|
163
|
+
ERR__INVALID_DIFFERENT_RECORD: -138,
|
|
164
|
+
/** Broker is going away but client isn't terminating */
|
|
165
|
+
ERR__DESTROY_BROKER: -137,
|
|
161
166
|
/** End internal error codes */
|
|
162
167
|
ERR__END: -100,
|
|
163
168
|
/* Kafka broker errors: */
|
|
@@ -373,7 +378,28 @@ LibrdKafkaError.codes = {
|
|
|
373
378
|
/** Unable to update finalized features due to server error */
|
|
374
379
|
ERR_FEATURE_UPDATE_FAILED: 96,
|
|
375
380
|
/** Request principal deserialization failed during forwarding */
|
|
376
|
-
ERR_PRINCIPAL_DESERIALIZATION_FAILURE: 97
|
|
381
|
+
ERR_PRINCIPAL_DESERIALIZATION_FAILURE: 97,
|
|
382
|
+
/** Unknown Topic Id */
|
|
383
|
+
ERR_UNKNOWN_TOPIC_ID: 100,
|
|
384
|
+
/** The member epoch is fenced by the group coordinator */
|
|
385
|
+
ERR_FENCED_MEMBER_EPOCH: 110,
|
|
386
|
+
/** The instance ID is still used by another member in the
|
|
387
|
+
* consumer group */
|
|
388
|
+
ERR_UNRELEASED_INSTANCE_ID: 111,
|
|
389
|
+
/** The assignor or its version range is not supported by the consumer
|
|
390
|
+
* group */
|
|
391
|
+
ERR_UNSUPPORTED_ASSIGNOR: 112,
|
|
392
|
+
/** The member epoch is stale */
|
|
393
|
+
ERR_STALE_MEMBER_EPOCH: 113,
|
|
394
|
+
/** Client sent a push telemetry request with an invalid or outdated
|
|
395
|
+
* subscription ID. */
|
|
396
|
+
ERR_UNKNOWN_SUBSCRIPTION_ID: 117,
|
|
397
|
+
/** Client sent a push telemetry request larger than the maximum size
|
|
398
|
+
* the broker will accept. */
|
|
399
|
+
ERR_TELEMETRY_TOO_LARGE: 118,
|
|
400
|
+
/** Client metadata is stale,
|
|
401
|
+
* client should rebootstrap to obtain new metadata. */
|
|
402
|
+
ERR_REBOOTSTRAP_REQUIRED: 129
|
|
377
403
|
};
|
|
378
404
|
|
|
379
405
|
/**
|
|
@@ -405,7 +431,7 @@ function LibrdKafkaError(e) {
|
|
|
405
431
|
this.origin = 'kafka';
|
|
406
432
|
}
|
|
407
433
|
Error.captureStackTrace(this, this.constructor);
|
|
408
|
-
} else if (!
|
|
434
|
+
} else if (!(e instanceof Error || Object.prototype.toString.call(e) === '[object Error]')) {
|
|
409
435
|
// This is the better way
|
|
410
436
|
this.message = e.message;
|
|
411
437
|
this.code = e.code;
|
package/make_docs.sh
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/rdkafka",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Node.js bindings for librdkafka",
|
|
5
|
-
"librdkafka": "2.
|
|
5
|
+
"librdkafka": "2.12.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"configure": "node-gyp configure",
|
|
9
|
-
"build": "node-gyp build --debug",
|
|
10
|
-
"test": "make test",
|
|
11
|
-
"install": "node-gyp rebuild",
|
|
12
|
-
"prepack": "node ./ci/prepublish.js"
|
|
13
|
-
},
|
|
14
7
|
"keywords": [
|
|
15
8
|
"kafka",
|
|
16
9
|
"librdkafka"
|
|
@@ -39,15 +32,22 @@
|
|
|
39
32
|
"jsdoc": "^4.0.2",
|
|
40
33
|
"jshint": "^2.10.1",
|
|
41
34
|
"mocha": "^11.7.0",
|
|
42
|
-
"node-gyp": "^
|
|
35
|
+
"node-gyp": "^11.1.0",
|
|
36
|
+
"semver": "^7.8.5",
|
|
43
37
|
"taffydb": "^2.7.3",
|
|
44
38
|
"toolkit-jsdoc": "^1.0.0"
|
|
45
39
|
},
|
|
46
40
|
"dependencies": {
|
|
47
41
|
"bindings": "^1.3.1",
|
|
48
|
-
"nan": "^2.
|
|
42
|
+
"nan": "^2.24.0"
|
|
49
43
|
},
|
|
50
44
|
"engines": {
|
|
51
45
|
"node": ">=16"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"configure": "node-gyp configure",
|
|
49
|
+
"build": "node-gyp build --debug",
|
|
50
|
+
"test": "make test",
|
|
51
|
+
"install": "node-gyp rebuild"
|
|
52
52
|
}
|
|
53
53
|
}
|
package/run_docker.sh
CHANGED
|
File without changes
|
package/src/callbacks.cc
CHANGED
|
@@ -57,7 +57,7 @@ Dispatcher::~Dispatcher() {
|
|
|
57
57
|
if (callbacks.size() < 1) return;
|
|
58
58
|
|
|
59
59
|
for (size_t i=0; i < callbacks.size(); i++) {
|
|
60
|
-
callbacks[i]
|
|
60
|
+
delete callbacks[i];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
Deactivate();
|
|
@@ -100,24 +100,21 @@ void Dispatcher::Dispatch(const int _argc, Local<Value> _argv[]) {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
for (size_t i=0; i < callbacks.size(); i++) {
|
|
103
|
-
|
|
104
|
-
Nan::Callback cb(f);
|
|
105
|
-
cb.Call(_argc, _argv);
|
|
103
|
+
callbacks[i]->Call(_argc, _argv);
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
void Dispatcher::AddCallback(const v8::Local<v8::Function> &cb) {
|
|
110
|
-
Nan::
|
|
111
|
-
Nan::CopyablePersistentTraits<v8::Function> > value(cb);
|
|
112
|
-
// PersistentCopyableFunction value(func);
|
|
108
|
+
Nan::Callback *value = new Nan::Callback(cb);
|
|
113
109
|
callbacks.push_back(value);
|
|
114
110
|
}
|
|
115
111
|
|
|
116
112
|
void Dispatcher::RemoveCallback(const v8::Local<v8::Function> &cb) {
|
|
117
113
|
for (size_t i=0; i < callbacks.size(); i++) {
|
|
118
|
-
if (callbacks[i] == cb) {
|
|
119
|
-
callbacks[i]
|
|
114
|
+
if (callbacks[i]->GetFunction() == cb) {
|
|
115
|
+
Nan::Callback *found_callback = callbacks[i];
|
|
120
116
|
callbacks.erase(callbacks.begin() + i);
|
|
117
|
+
delete found_callback;
|
|
121
118
|
break;
|
|
122
119
|
}
|
|
123
120
|
}
|
package/src/callbacks.h
CHANGED
|
@@ -18,10 +18,6 @@
|
|
|
18
18
|
#include "rdkafkacpp.h"
|
|
19
19
|
#include "src/common.h"
|
|
20
20
|
|
|
21
|
-
typedef Nan::Persistent<v8::Function,
|
|
22
|
-
Nan::CopyablePersistentTraits<v8::Function> > PersistentCopyableFunction;
|
|
23
|
-
typedef std::vector<PersistentCopyableFunction> CopyableFunctionList;
|
|
24
|
-
|
|
25
21
|
namespace NodeKafka {
|
|
26
22
|
|
|
27
23
|
class KafkaConsumer;
|
|
@@ -42,7 +38,7 @@ class Dispatcher {
|
|
|
42
38
|
void Deactivate();
|
|
43
39
|
|
|
44
40
|
protected:
|
|
45
|
-
|
|
41
|
+
std::vector<Nan::Callback*> callbacks; // NOLINT
|
|
46
42
|
|
|
47
43
|
uv_mutex_t async_lock;
|
|
48
44
|
|