@point3/node-rdkafka 3.6.0-1
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/LICENSE.txt +20 -0
- package/README.md +636 -0
- package/binding.gyp +154 -0
- package/deps/librdkafka/.clang-format +136 -0
- package/deps/librdkafka/.clang-format-cpp +103 -0
- package/deps/librdkafka/.dir-locals.el +10 -0
- package/deps/librdkafka/.formatignore +33 -0
- package/deps/librdkafka/.gdbmacros +19 -0
- package/deps/librdkafka/.github/CODEOWNERS +1 -0
- package/deps/librdkafka/.github/ISSUE_TEMPLATE +34 -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 +378 -0
- package/deps/librdkafka/.semaphore/verify-linux-packages.yml +41 -0
- package/deps/librdkafka/CHANGELOG.md +2208 -0
- package/deps/librdkafka/CMakeLists.txt +291 -0
- package/deps/librdkafka/CODE_OF_CONDUCT.md +46 -0
- package/deps/librdkafka/CONFIGURATION.md +209 -0
- package/deps/librdkafka/CONTRIBUTING.md +431 -0
- package/deps/librdkafka/Doxyfile +2375 -0
- package/deps/librdkafka/INTRODUCTION.md +2481 -0
- package/deps/librdkafka/LICENSE +26 -0
- package/deps/librdkafka/LICENSE.cjson +22 -0
- package/deps/librdkafka/LICENSE.crc32c +28 -0
- package/deps/librdkafka/LICENSE.fnv1a +18 -0
- package/deps/librdkafka/LICENSE.hdrhistogram +27 -0
- package/deps/librdkafka/LICENSE.lz4 +26 -0
- package/deps/librdkafka/LICENSE.murmur2 +25 -0
- package/deps/librdkafka/LICENSE.nanopb +22 -0
- package/deps/librdkafka/LICENSE.opentelemetry +203 -0
- package/deps/librdkafka/LICENSE.pycrc +23 -0
- package/deps/librdkafka/LICENSE.queue +31 -0
- package/deps/librdkafka/LICENSE.regexp +5 -0
- package/deps/librdkafka/LICENSE.snappy +36 -0
- package/deps/librdkafka/LICENSE.tinycthread +26 -0
- package/deps/librdkafka/LICENSE.wingetopt +49 -0
- package/deps/librdkafka/LICENSES.txt +625 -0
- package/deps/librdkafka/Makefile +125 -0
- package/deps/librdkafka/README.md +199 -0
- package/deps/librdkafka/README.win32 +26 -0
- package/deps/librdkafka/STATISTICS.md +624 -0
- package/deps/librdkafka/configure +214 -0
- package/deps/librdkafka/configure.self +331 -0
- package/deps/librdkafka/debian/changelog +111 -0
- package/deps/librdkafka/debian/compat +1 -0
- package/deps/librdkafka/debian/control +71 -0
- package/deps/librdkafka/debian/copyright +99 -0
- package/deps/librdkafka/debian/gbp.conf +9 -0
- package/deps/librdkafka/debian/librdkafka++1.install +1 -0
- package/deps/librdkafka/debian/librdkafka-dev.examples +2 -0
- package/deps/librdkafka/debian/librdkafka-dev.install +9 -0
- package/deps/librdkafka/debian/librdkafka1.docs +5 -0
- package/deps/librdkafka/debian/librdkafka1.install +1 -0
- package/deps/librdkafka/debian/librdkafka1.symbols +135 -0
- package/deps/librdkafka/debian/rules +19 -0
- package/deps/librdkafka/debian/source/format +1 -0
- package/deps/librdkafka/debian/watch +2 -0
- package/deps/librdkafka/dev-conf.sh +123 -0
- package/deps/librdkafka/examples/CMakeLists.txt +79 -0
- package/deps/librdkafka/examples/Makefile +167 -0
- package/deps/librdkafka/examples/README.md +42 -0
- package/deps/librdkafka/examples/alter_consumer_group_offsets.c +338 -0
- package/deps/librdkafka/examples/consumer.c +271 -0
- package/deps/librdkafka/examples/delete_records.c +233 -0
- package/deps/librdkafka/examples/describe_cluster.c +322 -0
- package/deps/librdkafka/examples/describe_consumer_groups.c +455 -0
- package/deps/librdkafka/examples/describe_topics.c +427 -0
- package/deps/librdkafka/examples/elect_leaders.c +317 -0
- package/deps/librdkafka/examples/globals.json +11 -0
- package/deps/librdkafka/examples/idempotent_producer.c +344 -0
- package/deps/librdkafka/examples/incremental_alter_configs.c +347 -0
- package/deps/librdkafka/examples/kafkatest_verifiable_client.cpp +945 -0
- package/deps/librdkafka/examples/list_consumer_group_offsets.c +359 -0
- package/deps/librdkafka/examples/list_consumer_groups.c +365 -0
- package/deps/librdkafka/examples/list_offsets.c +327 -0
- package/deps/librdkafka/examples/misc.c +287 -0
- package/deps/librdkafka/examples/openssl_engine_example.cpp +248 -0
- package/deps/librdkafka/examples/producer.c +251 -0
- package/deps/librdkafka/examples/producer.cpp +228 -0
- package/deps/librdkafka/examples/rdkafka_complex_consumer_example.c +617 -0
- package/deps/librdkafka/examples/rdkafka_complex_consumer_example.cpp +467 -0
- package/deps/librdkafka/examples/rdkafka_consume_batch.cpp +264 -0
- package/deps/librdkafka/examples/rdkafka_example.c +853 -0
- package/deps/librdkafka/examples/rdkafka_example.cpp +679 -0
- package/deps/librdkafka/examples/rdkafka_performance.c +1781 -0
- package/deps/librdkafka/examples/transactions-older-broker.c +668 -0
- package/deps/librdkafka/examples/transactions.c +665 -0
- package/deps/librdkafka/examples/user_scram.c +491 -0
- package/deps/librdkafka/examples/win_ssl_cert_store.cpp +396 -0
- package/deps/librdkafka/lds-gen.py +73 -0
- package/deps/librdkafka/mainpage.doxy +40 -0
- package/deps/librdkafka/mklove/Makefile.base +329 -0
- package/deps/librdkafka/mklove/modules/configure.atomics +144 -0
- package/deps/librdkafka/mklove/modules/configure.base +2484 -0
- package/deps/librdkafka/mklove/modules/configure.builtin +70 -0
- package/deps/librdkafka/mklove/modules/configure.cc +186 -0
- package/deps/librdkafka/mklove/modules/configure.cxx +8 -0
- package/deps/librdkafka/mklove/modules/configure.fileversion +65 -0
- package/deps/librdkafka/mklove/modules/configure.gitversion +29 -0
- package/deps/librdkafka/mklove/modules/configure.good_cflags +18 -0
- package/deps/librdkafka/mklove/modules/configure.host +132 -0
- package/deps/librdkafka/mklove/modules/configure.lib +49 -0
- package/deps/librdkafka/mklove/modules/configure.libcurl +99 -0
- package/deps/librdkafka/mklove/modules/configure.libsasl2 +36 -0
- package/deps/librdkafka/mklove/modules/configure.libssl +147 -0
- package/deps/librdkafka/mklove/modules/configure.libzstd +58 -0
- package/deps/librdkafka/mklove/modules/configure.parseversion +95 -0
- package/deps/librdkafka/mklove/modules/configure.pic +16 -0
- package/deps/librdkafka/mklove/modules/configure.socket +20 -0
- package/deps/librdkafka/mklove/modules/configure.zlib +61 -0
- package/deps/librdkafka/mklove/modules/patches/README.md +8 -0
- package/deps/librdkafka/mklove/modules/patches/libcurl.0000-no-runtime-linking-check.patch +11 -0
- package/deps/librdkafka/mklove/modules/patches/libssl.0000-osx-rand-include-fix-OpenSSL-PR16409.patch +56 -0
- package/deps/librdkafka/packaging/RELEASE.md +319 -0
- package/deps/librdkafka/packaging/alpine/build-alpine.sh +38 -0
- package/deps/librdkafka/packaging/archlinux/PKGBUILD +30 -0
- package/deps/librdkafka/packaging/cmake/Config.cmake.in +37 -0
- package/deps/librdkafka/packaging/cmake/Modules/FindLZ4.cmake +38 -0
- package/deps/librdkafka/packaging/cmake/Modules/FindZSTD.cmake +27 -0
- package/deps/librdkafka/packaging/cmake/Modules/LICENSE.FindZstd +178 -0
- package/deps/librdkafka/packaging/cmake/README.md +38 -0
- package/deps/librdkafka/packaging/cmake/config.h.in +52 -0
- package/deps/librdkafka/packaging/cmake/parseversion.cmake +60 -0
- package/deps/librdkafka/packaging/cmake/rdkafka.pc.in +12 -0
- package/deps/librdkafka/packaging/cmake/try_compile/atomic_32_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/atomic_64_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/c11threads_test.c +14 -0
- package/deps/librdkafka/packaging/cmake/try_compile/crc32c_hw_test.c +27 -0
- package/deps/librdkafka/packaging/cmake/try_compile/dlopen_test.c +11 -0
- package/deps/librdkafka/packaging/cmake/try_compile/libsasl2_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_darwin_test.c +6 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_freebsd_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_gnu_test.c +5 -0
- package/deps/librdkafka/packaging/cmake/try_compile/rand_r_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/rdkafka_setup.cmake +122 -0
- package/deps/librdkafka/packaging/cmake/try_compile/regex_test.c +10 -0
- package/deps/librdkafka/packaging/cmake/try_compile/strndup_test.c +5 -0
- package/deps/librdkafka/packaging/cmake/try_compile/sync_32_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/sync_64_test.c +8 -0
- package/deps/librdkafka/packaging/cp/README.md +16 -0
- package/deps/librdkafka/packaging/cp/check_features.c +72 -0
- package/deps/librdkafka/packaging/cp/verify-deb.sh +33 -0
- package/deps/librdkafka/packaging/cp/verify-packages.sh +69 -0
- package/deps/librdkafka/packaging/cp/verify-rpm.sh +32 -0
- package/deps/librdkafka/packaging/debian/changelog +66 -0
- package/deps/librdkafka/packaging/debian/compat +1 -0
- package/deps/librdkafka/packaging/debian/control +49 -0
- package/deps/librdkafka/packaging/debian/copyright +84 -0
- package/deps/librdkafka/packaging/debian/docs +5 -0
- package/deps/librdkafka/packaging/debian/gbp.conf +9 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.dirs +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.examples +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.install +6 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.substvars +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka.dsc +16 -0
- package/deps/librdkafka/packaging/debian/librdkafka1-dbg.substvars +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.dirs +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.install +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.postinst.debhelper +5 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.postrm.debhelper +5 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.symbols +64 -0
- package/deps/librdkafka/packaging/debian/rules +19 -0
- package/deps/librdkafka/packaging/debian/source/format +1 -0
- package/deps/librdkafka/packaging/debian/watch +2 -0
- package/deps/librdkafka/packaging/get_version.py +21 -0
- package/deps/librdkafka/packaging/homebrew/README.md +15 -0
- package/deps/librdkafka/packaging/homebrew/brew-update-pr.sh +31 -0
- package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw-static.sh +52 -0
- package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw.sh +21 -0
- package/deps/librdkafka/packaging/mingw-w64/export-variables.sh +13 -0
- package/deps/librdkafka/packaging/mingw-w64/run-tests.sh +6 -0
- package/deps/librdkafka/packaging/mingw-w64/semaphoreci-build.sh +38 -0
- package/deps/librdkafka/packaging/nuget/README.md +84 -0
- package/deps/librdkafka/packaging/nuget/artifact.py +177 -0
- package/deps/librdkafka/packaging/nuget/cleanup-s3.py +143 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr120.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr140.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr120.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr140.zip +0 -0
- package/deps/librdkafka/packaging/nuget/nuget.sh +21 -0
- package/deps/librdkafka/packaging/nuget/nugetpackage.py +278 -0
- package/deps/librdkafka/packaging/nuget/packaging.py +448 -0
- package/deps/librdkafka/packaging/nuget/push-to-nuget.sh +21 -0
- package/deps/librdkafka/packaging/nuget/release.py +167 -0
- package/deps/librdkafka/packaging/nuget/requirements.txt +3 -0
- package/deps/librdkafka/packaging/nuget/staticpackage.py +178 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.nuspec +21 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.props +18 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.targets +19 -0
- package/deps/librdkafka/packaging/nuget/zfile/__init__.py +0 -0
- package/deps/librdkafka/packaging/nuget/zfile/zfile.py +98 -0
- package/deps/librdkafka/packaging/rpm/Makefile +92 -0
- package/deps/librdkafka/packaging/rpm/README.md +23 -0
- package/deps/librdkafka/packaging/rpm/el7-x86_64.cfg +40 -0
- package/deps/librdkafka/packaging/rpm/librdkafka.spec +118 -0
- package/deps/librdkafka/packaging/rpm/mock-on-docker.sh +96 -0
- package/deps/librdkafka/packaging/rpm/tests/Makefile +25 -0
- package/deps/librdkafka/packaging/rpm/tests/README.md +8 -0
- package/deps/librdkafka/packaging/rpm/tests/run-test.sh +42 -0
- package/deps/librdkafka/packaging/rpm/tests/test-on-docker.sh +56 -0
- package/deps/librdkafka/packaging/rpm/tests/test.c +77 -0
- package/deps/librdkafka/packaging/rpm/tests/test.cpp +34 -0
- package/deps/librdkafka/packaging/tools/Dockerfile +31 -0
- package/deps/librdkafka/packaging/tools/build-configurations-checks.sh +12 -0
- package/deps/librdkafka/packaging/tools/build-deb-package.sh +64 -0
- package/deps/librdkafka/packaging/tools/build-debian.sh +65 -0
- package/deps/librdkafka/packaging/tools/build-manylinux.sh +68 -0
- package/deps/librdkafka/packaging/tools/build-release-artifacts.sh +139 -0
- package/deps/librdkafka/packaging/tools/distro-build.sh +38 -0
- package/deps/librdkafka/packaging/tools/gh-release-checksums.py +39 -0
- package/deps/librdkafka/packaging/tools/rdutcoverage.sh +25 -0
- package/deps/librdkafka/packaging/tools/requirements.txt +2 -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 +149 -0
- package/deps/librdkafka/packaging/tools/update_rpcs_max_versions.py +100 -0
- package/deps/librdkafka/service.yml +172 -0
- package/deps/librdkafka/src/CMakeLists.txt +374 -0
- package/deps/librdkafka/src/Makefile +103 -0
- package/deps/librdkafka/src/README.lz4.md +30 -0
- package/deps/librdkafka/src/cJSON.c +2834 -0
- package/deps/librdkafka/src/cJSON.h +398 -0
- package/deps/librdkafka/src/crc32c.c +430 -0
- package/deps/librdkafka/src/crc32c.h +38 -0
- package/deps/librdkafka/src/generate_proto.sh +66 -0
- package/deps/librdkafka/src/librdkafka_cgrp_synch.png +0 -0
- package/deps/librdkafka/src/lz4.c +2727 -0
- package/deps/librdkafka/src/lz4.h +842 -0
- package/deps/librdkafka/src/lz4frame.c +2078 -0
- package/deps/librdkafka/src/lz4frame.h +692 -0
- package/deps/librdkafka/src/lz4frame_static.h +47 -0
- package/deps/librdkafka/src/lz4hc.c +1631 -0
- package/deps/librdkafka/src/lz4hc.h +413 -0
- package/deps/librdkafka/src/nanopb/pb.h +917 -0
- package/deps/librdkafka/src/nanopb/pb_common.c +388 -0
- package/deps/librdkafka/src/nanopb/pb_common.h +49 -0
- package/deps/librdkafka/src/nanopb/pb_decode.c +1727 -0
- package/deps/librdkafka/src/nanopb/pb_decode.h +193 -0
- package/deps/librdkafka/src/nanopb/pb_encode.c +1000 -0
- package/deps/librdkafka/src/nanopb/pb_encode.h +185 -0
- package/deps/librdkafka/src/opentelemetry/common.pb.c +32 -0
- package/deps/librdkafka/src/opentelemetry/common.pb.h +170 -0
- package/deps/librdkafka/src/opentelemetry/metrics.options +2 -0
- package/deps/librdkafka/src/opentelemetry/metrics.pb.c +67 -0
- package/deps/librdkafka/src/opentelemetry/metrics.pb.h +966 -0
- package/deps/librdkafka/src/opentelemetry/resource.pb.c +12 -0
- package/deps/librdkafka/src/opentelemetry/resource.pb.h +58 -0
- package/deps/librdkafka/src/queue.h +850 -0
- package/deps/librdkafka/src/rd.h +584 -0
- package/deps/librdkafka/src/rdaddr.c +255 -0
- package/deps/librdkafka/src/rdaddr.h +202 -0
- package/deps/librdkafka/src/rdatomic.h +230 -0
- package/deps/librdkafka/src/rdavg.h +260 -0
- package/deps/librdkafka/src/rdavl.c +210 -0
- package/deps/librdkafka/src/rdavl.h +250 -0
- package/deps/librdkafka/src/rdbase64.c +200 -0
- package/deps/librdkafka/src/rdbase64.h +43 -0
- package/deps/librdkafka/src/rdbuf.c +1884 -0
- package/deps/librdkafka/src/rdbuf.h +375 -0
- package/deps/librdkafka/src/rdcrc32.c +114 -0
- package/deps/librdkafka/src/rdcrc32.h +170 -0
- package/deps/librdkafka/src/rddl.c +179 -0
- package/deps/librdkafka/src/rddl.h +43 -0
- package/deps/librdkafka/src/rdendian.h +175 -0
- package/deps/librdkafka/src/rdfloat.h +67 -0
- package/deps/librdkafka/src/rdfnv1a.c +113 -0
- package/deps/librdkafka/src/rdfnv1a.h +35 -0
- package/deps/librdkafka/src/rdgz.c +120 -0
- package/deps/librdkafka/src/rdgz.h +46 -0
- package/deps/librdkafka/src/rdhdrhistogram.c +721 -0
- package/deps/librdkafka/src/rdhdrhistogram.h +87 -0
- package/deps/librdkafka/src/rdhttp.c +830 -0
- package/deps/librdkafka/src/rdhttp.h +101 -0
- package/deps/librdkafka/src/rdinterval.h +177 -0
- package/deps/librdkafka/src/rdkafka.c +5505 -0
- package/deps/librdkafka/src/rdkafka.h +10686 -0
- package/deps/librdkafka/src/rdkafka_admin.c +9794 -0
- package/deps/librdkafka/src/rdkafka_admin.h +661 -0
- package/deps/librdkafka/src/rdkafka_assignment.c +1010 -0
- package/deps/librdkafka/src/rdkafka_assignment.h +73 -0
- package/deps/librdkafka/src/rdkafka_assignor.c +1786 -0
- package/deps/librdkafka/src/rdkafka_assignor.h +402 -0
- package/deps/librdkafka/src/rdkafka_aux.c +409 -0
- package/deps/librdkafka/src/rdkafka_aux.h +174 -0
- package/deps/librdkafka/src/rdkafka_background.c +221 -0
- package/deps/librdkafka/src/rdkafka_broker.c +6337 -0
- package/deps/librdkafka/src/rdkafka_broker.h +744 -0
- package/deps/librdkafka/src/rdkafka_buf.c +543 -0
- package/deps/librdkafka/src/rdkafka_buf.h +1525 -0
- package/deps/librdkafka/src/rdkafka_cert.c +576 -0
- package/deps/librdkafka/src/rdkafka_cert.h +62 -0
- package/deps/librdkafka/src/rdkafka_cgrp.c +7587 -0
- package/deps/librdkafka/src/rdkafka_cgrp.h +477 -0
- package/deps/librdkafka/src/rdkafka_conf.c +4880 -0
- package/deps/librdkafka/src/rdkafka_conf.h +732 -0
- package/deps/librdkafka/src/rdkafka_confval.h +97 -0
- package/deps/librdkafka/src/rdkafka_coord.c +623 -0
- package/deps/librdkafka/src/rdkafka_coord.h +132 -0
- package/deps/librdkafka/src/rdkafka_error.c +228 -0
- package/deps/librdkafka/src/rdkafka_error.h +80 -0
- package/deps/librdkafka/src/rdkafka_event.c +502 -0
- package/deps/librdkafka/src/rdkafka_event.h +126 -0
- package/deps/librdkafka/src/rdkafka_feature.c +898 -0
- package/deps/librdkafka/src/rdkafka_feature.h +104 -0
- package/deps/librdkafka/src/rdkafka_fetcher.c +1422 -0
- package/deps/librdkafka/src/rdkafka_fetcher.h +44 -0
- package/deps/librdkafka/src/rdkafka_header.c +220 -0
- package/deps/librdkafka/src/rdkafka_header.h +76 -0
- package/deps/librdkafka/src/rdkafka_idempotence.c +807 -0
- package/deps/librdkafka/src/rdkafka_idempotence.h +144 -0
- package/deps/librdkafka/src/rdkafka_int.h +1260 -0
- package/deps/librdkafka/src/rdkafka_interceptor.c +819 -0
- package/deps/librdkafka/src/rdkafka_interceptor.h +104 -0
- package/deps/librdkafka/src/rdkafka_lz4.c +450 -0
- package/deps/librdkafka/src/rdkafka_lz4.h +49 -0
- package/deps/librdkafka/src/rdkafka_metadata.c +2209 -0
- package/deps/librdkafka/src/rdkafka_metadata.h +345 -0
- package/deps/librdkafka/src/rdkafka_metadata_cache.c +1183 -0
- package/deps/librdkafka/src/rdkafka_mock.c +3661 -0
- package/deps/librdkafka/src/rdkafka_mock.h +610 -0
- package/deps/librdkafka/src/rdkafka_mock_cgrp.c +1876 -0
- package/deps/librdkafka/src/rdkafka_mock_handlers.c +3113 -0
- package/deps/librdkafka/src/rdkafka_mock_int.h +710 -0
- package/deps/librdkafka/src/rdkafka_msg.c +2589 -0
- package/deps/librdkafka/src/rdkafka_msg.h +614 -0
- package/deps/librdkafka/src/rdkafka_msgbatch.h +62 -0
- package/deps/librdkafka/src/rdkafka_msgset.h +98 -0
- package/deps/librdkafka/src/rdkafka_msgset_reader.c +1806 -0
- package/deps/librdkafka/src/rdkafka_msgset_writer.c +1474 -0
- package/deps/librdkafka/src/rdkafka_offset.c +1565 -0
- package/deps/librdkafka/src/rdkafka_offset.h +150 -0
- package/deps/librdkafka/src/rdkafka_op.c +997 -0
- package/deps/librdkafka/src/rdkafka_op.h +858 -0
- package/deps/librdkafka/src/rdkafka_partition.c +4896 -0
- package/deps/librdkafka/src/rdkafka_partition.h +1182 -0
- package/deps/librdkafka/src/rdkafka_pattern.c +228 -0
- package/deps/librdkafka/src/rdkafka_pattern.h +70 -0
- package/deps/librdkafka/src/rdkafka_plugin.c +213 -0
- package/deps/librdkafka/src/rdkafka_plugin.h +41 -0
- package/deps/librdkafka/src/rdkafka_proto.h +736 -0
- package/deps/librdkafka/src/rdkafka_protocol.h +128 -0
- package/deps/librdkafka/src/rdkafka_queue.c +1230 -0
- package/deps/librdkafka/src/rdkafka_queue.h +1220 -0
- package/deps/librdkafka/src/rdkafka_range_assignor.c +1748 -0
- package/deps/librdkafka/src/rdkafka_request.c +7089 -0
- package/deps/librdkafka/src/rdkafka_request.h +732 -0
- package/deps/librdkafka/src/rdkafka_roundrobin_assignor.c +123 -0
- package/deps/librdkafka/src/rdkafka_sasl.c +530 -0
- package/deps/librdkafka/src/rdkafka_sasl.h +63 -0
- package/deps/librdkafka/src/rdkafka_sasl_cyrus.c +722 -0
- package/deps/librdkafka/src/rdkafka_sasl_int.h +89 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.c +1833 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.h +52 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c +1666 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.h +47 -0
- package/deps/librdkafka/src/rdkafka_sasl_plain.c +142 -0
- package/deps/librdkafka/src/rdkafka_sasl_scram.c +858 -0
- package/deps/librdkafka/src/rdkafka_sasl_win32.c +550 -0
- package/deps/librdkafka/src/rdkafka_ssl.c +2129 -0
- package/deps/librdkafka/src/rdkafka_ssl.h +86 -0
- package/deps/librdkafka/src/rdkafka_sticky_assignor.c +4785 -0
- package/deps/librdkafka/src/rdkafka_subscription.c +278 -0
- package/deps/librdkafka/src/rdkafka_telemetry.c +760 -0
- package/deps/librdkafka/src/rdkafka_telemetry.h +52 -0
- package/deps/librdkafka/src/rdkafka_telemetry_decode.c +1053 -0
- package/deps/librdkafka/src/rdkafka_telemetry_decode.h +59 -0
- package/deps/librdkafka/src/rdkafka_telemetry_encode.c +997 -0
- package/deps/librdkafka/src/rdkafka_telemetry_encode.h +301 -0
- package/deps/librdkafka/src/rdkafka_timer.c +402 -0
- package/deps/librdkafka/src/rdkafka_timer.h +117 -0
- package/deps/librdkafka/src/rdkafka_topic.c +2161 -0
- package/deps/librdkafka/src/rdkafka_topic.h +334 -0
- package/deps/librdkafka/src/rdkafka_transport.c +1309 -0
- package/deps/librdkafka/src/rdkafka_transport.h +99 -0
- package/deps/librdkafka/src/rdkafka_transport_int.h +100 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.c +3256 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.h +171 -0
- package/deps/librdkafka/src/rdkafka_zstd.c +226 -0
- package/deps/librdkafka/src/rdkafka_zstd.h +57 -0
- package/deps/librdkafka/src/rdlist.c +576 -0
- package/deps/librdkafka/src/rdlist.h +434 -0
- package/deps/librdkafka/src/rdlog.c +89 -0
- package/deps/librdkafka/src/rdlog.h +41 -0
- package/deps/librdkafka/src/rdmap.c +508 -0
- package/deps/librdkafka/src/rdmap.h +492 -0
- package/deps/librdkafka/src/rdmurmur2.c +167 -0
- package/deps/librdkafka/src/rdmurmur2.h +35 -0
- package/deps/librdkafka/src/rdports.c +61 -0
- package/deps/librdkafka/src/rdports.h +38 -0
- package/deps/librdkafka/src/rdposix.h +250 -0
- package/deps/librdkafka/src/rdrand.c +80 -0
- package/deps/librdkafka/src/rdrand.h +43 -0
- package/deps/librdkafka/src/rdregex.c +156 -0
- package/deps/librdkafka/src/rdregex.h +43 -0
- package/deps/librdkafka/src/rdsignal.h +57 -0
- package/deps/librdkafka/src/rdstring.c +645 -0
- package/deps/librdkafka/src/rdstring.h +98 -0
- package/deps/librdkafka/src/rdsysqueue.h +404 -0
- package/deps/librdkafka/src/rdtime.h +356 -0
- package/deps/librdkafka/src/rdtypes.h +86 -0
- package/deps/librdkafka/src/rdunittest.c +549 -0
- package/deps/librdkafka/src/rdunittest.h +232 -0
- package/deps/librdkafka/src/rdvarint.c +134 -0
- package/deps/librdkafka/src/rdvarint.h +165 -0
- package/deps/librdkafka/src/rdwin32.h +382 -0
- package/deps/librdkafka/src/rdxxhash.c +1030 -0
- package/deps/librdkafka/src/rdxxhash.h +328 -0
- package/deps/librdkafka/src/regexp.c +1352 -0
- package/deps/librdkafka/src/regexp.h +41 -0
- package/deps/librdkafka/src/snappy.c +1866 -0
- package/deps/librdkafka/src/snappy.h +62 -0
- package/deps/librdkafka/src/snappy_compat.h +138 -0
- package/deps/librdkafka/src/statistics_schema.json +444 -0
- package/deps/librdkafka/src/tinycthread.c +932 -0
- package/deps/librdkafka/src/tinycthread.h +503 -0
- package/deps/librdkafka/src/tinycthread_extra.c +199 -0
- package/deps/librdkafka/src/tinycthread_extra.h +212 -0
- package/deps/librdkafka/src/win32_config.h +58 -0
- package/deps/librdkafka/src-cpp/CMakeLists.txt +90 -0
- package/deps/librdkafka/src-cpp/ConfImpl.cpp +84 -0
- package/deps/librdkafka/src-cpp/ConsumerImpl.cpp +244 -0
- package/deps/librdkafka/src-cpp/HandleImpl.cpp +436 -0
- package/deps/librdkafka/src-cpp/HeadersImpl.cpp +48 -0
- package/deps/librdkafka/src-cpp/KafkaConsumerImpl.cpp +296 -0
- package/deps/librdkafka/src-cpp/Makefile +55 -0
- package/deps/librdkafka/src-cpp/MessageImpl.cpp +38 -0
- package/deps/librdkafka/src-cpp/MetadataImpl.cpp +170 -0
- package/deps/librdkafka/src-cpp/ProducerImpl.cpp +197 -0
- package/deps/librdkafka/src-cpp/QueueImpl.cpp +70 -0
- package/deps/librdkafka/src-cpp/README.md +16 -0
- package/deps/librdkafka/src-cpp/RdKafka.cpp +59 -0
- package/deps/librdkafka/src-cpp/TopicImpl.cpp +124 -0
- package/deps/librdkafka/src-cpp/TopicPartitionImpl.cpp +57 -0
- package/deps/librdkafka/src-cpp/rdkafkacpp.h +3797 -0
- package/deps/librdkafka/src-cpp/rdkafkacpp_int.h +1641 -0
- package/deps/librdkafka/tests/0000-unittests.c +72 -0
- package/deps/librdkafka/tests/0001-multiobj.c +102 -0
- package/deps/librdkafka/tests/0002-unkpart.c +244 -0
- package/deps/librdkafka/tests/0003-msgmaxsize.c +173 -0
- package/deps/librdkafka/tests/0004-conf.c +934 -0
- package/deps/librdkafka/tests/0005-order.c +133 -0
- package/deps/librdkafka/tests/0006-symbols.c +163 -0
- package/deps/librdkafka/tests/0007-autotopic.c +136 -0
- package/deps/librdkafka/tests/0008-reqacks.c +179 -0
- package/deps/librdkafka/tests/0009-mock_cluster.c +97 -0
- package/deps/librdkafka/tests/0011-produce_batch.c +753 -0
- package/deps/librdkafka/tests/0012-produce_consume.c +537 -0
- package/deps/librdkafka/tests/0013-null-msgs.c +473 -0
- package/deps/librdkafka/tests/0014-reconsume-191.c +512 -0
- package/deps/librdkafka/tests/0015-offset_seeks.c +172 -0
- package/deps/librdkafka/tests/0016-client_swname.c +181 -0
- package/deps/librdkafka/tests/0017-compression.c +140 -0
- package/deps/librdkafka/tests/0018-cgrp_term.c +338 -0
- package/deps/librdkafka/tests/0019-list_groups.c +289 -0
- package/deps/librdkafka/tests/0020-destroy_hang.c +162 -0
- package/deps/librdkafka/tests/0021-rkt_destroy.c +72 -0
- package/deps/librdkafka/tests/0022-consume_batch.c +279 -0
- package/deps/librdkafka/tests/0025-timers.c +147 -0
- package/deps/librdkafka/tests/0026-consume_pause.c +547 -0
- package/deps/librdkafka/tests/0028-long_topicnames.c +79 -0
- package/deps/librdkafka/tests/0029-assign_offset.c +202 -0
- package/deps/librdkafka/tests/0030-offset_commit.c +589 -0
- package/deps/librdkafka/tests/0031-get_offsets.c +235 -0
- package/deps/librdkafka/tests/0033-regex_subscribe.c +536 -0
- package/deps/librdkafka/tests/0034-offset_reset.c +398 -0
- package/deps/librdkafka/tests/0035-api_version.c +73 -0
- package/deps/librdkafka/tests/0036-partial_fetch.c +87 -0
- package/deps/librdkafka/tests/0037-destroy_hang_local.c +85 -0
- package/deps/librdkafka/tests/0038-performance.c +121 -0
- package/deps/librdkafka/tests/0039-event.c +284 -0
- package/deps/librdkafka/tests/0040-io_event.c +257 -0
- package/deps/librdkafka/tests/0041-fetch_max_bytes.c +97 -0
- package/deps/librdkafka/tests/0042-many_topics.c +252 -0
- package/deps/librdkafka/tests/0043-no_connection.c +77 -0
- package/deps/librdkafka/tests/0044-partition_cnt.c +94 -0
- package/deps/librdkafka/tests/0045-subscribe_update.c +1010 -0
- package/deps/librdkafka/tests/0046-rkt_cache.c +65 -0
- package/deps/librdkafka/tests/0047-partial_buf_tmout.c +98 -0
- package/deps/librdkafka/tests/0048-partitioner.c +283 -0
- package/deps/librdkafka/tests/0049-consume_conn_close.c +162 -0
- package/deps/librdkafka/tests/0050-subscribe_adds.c +145 -0
- package/deps/librdkafka/tests/0051-assign_adds.c +126 -0
- package/deps/librdkafka/tests/0052-msg_timestamps.c +238 -0
- package/deps/librdkafka/tests/0053-stats_cb.cpp +527 -0
- package/deps/librdkafka/tests/0054-offset_time.cpp +236 -0
- package/deps/librdkafka/tests/0055-producer_latency.c +539 -0
- package/deps/librdkafka/tests/0056-balanced_group_mt.c +315 -0
- package/deps/librdkafka/tests/0057-invalid_topic.cpp +112 -0
- package/deps/librdkafka/tests/0058-log.cpp +123 -0
- package/deps/librdkafka/tests/0059-bsearch.cpp +241 -0
- package/deps/librdkafka/tests/0060-op_prio.cpp +163 -0
- package/deps/librdkafka/tests/0061-consumer_lag.cpp +295 -0
- package/deps/librdkafka/tests/0062-stats_event.c +126 -0
- package/deps/librdkafka/tests/0063-clusterid.cpp +180 -0
- package/deps/librdkafka/tests/0064-interceptors.c +481 -0
- package/deps/librdkafka/tests/0065-yield.cpp +140 -0
- package/deps/librdkafka/tests/0066-plugins.cpp +129 -0
- package/deps/librdkafka/tests/0067-empty_topic.cpp +151 -0
- package/deps/librdkafka/tests/0068-produce_timeout.c +136 -0
- package/deps/librdkafka/tests/0069-consumer_add_parts.c +119 -0
- package/deps/librdkafka/tests/0070-null_empty.cpp +197 -0
- package/deps/librdkafka/tests/0072-headers_ut.c +448 -0
- package/deps/librdkafka/tests/0073-headers.c +381 -0
- package/deps/librdkafka/tests/0074-producev.c +87 -0
- package/deps/librdkafka/tests/0075-retry.c +290 -0
- package/deps/librdkafka/tests/0076-produce_retry.c +452 -0
- package/deps/librdkafka/tests/0077-compaction.c +363 -0
- package/deps/librdkafka/tests/0078-c_from_cpp.cpp +96 -0
- package/deps/librdkafka/tests/0079-fork.c +93 -0
- package/deps/librdkafka/tests/0080-admin_ut.c +3095 -0
- package/deps/librdkafka/tests/0081-admin.c +5633 -0
- package/deps/librdkafka/tests/0082-fetch_max_bytes.cpp +137 -0
- package/deps/librdkafka/tests/0083-cb_event.c +233 -0
- package/deps/librdkafka/tests/0084-destroy_flags.c +208 -0
- package/deps/librdkafka/tests/0085-headers.cpp +392 -0
- package/deps/librdkafka/tests/0086-purge.c +368 -0
- package/deps/librdkafka/tests/0088-produce_metadata_timeout.c +162 -0
- package/deps/librdkafka/tests/0089-max_poll_interval.c +511 -0
- package/deps/librdkafka/tests/0090-idempotence.c +171 -0
- package/deps/librdkafka/tests/0091-max_poll_interval_timeout.c +295 -0
- package/deps/librdkafka/tests/0092-mixed_msgver.c +103 -0
- package/deps/librdkafka/tests/0093-holb.c +200 -0
- package/deps/librdkafka/tests/0094-idempotence_msg_timeout.c +231 -0
- package/deps/librdkafka/tests/0095-all_brokers_down.cpp +122 -0
- package/deps/librdkafka/tests/0097-ssl_verify.cpp +658 -0
- package/deps/librdkafka/tests/0098-consumer-txn.cpp +1218 -0
- package/deps/librdkafka/tests/0099-commit_metadata.c +194 -0
- package/deps/librdkafka/tests/0100-thread_interceptors.cpp +195 -0
- package/deps/librdkafka/tests/0101-fetch-from-follower.cpp +446 -0
- package/deps/librdkafka/tests/0102-static_group_rebalance.c +836 -0
- package/deps/librdkafka/tests/0103-transactions.c +1383 -0
- package/deps/librdkafka/tests/0104-fetch_from_follower_mock.c +625 -0
- package/deps/librdkafka/tests/0105-transactions_mock.c +3930 -0
- package/deps/librdkafka/tests/0106-cgrp_sess_timeout.c +318 -0
- package/deps/librdkafka/tests/0107-topic_recreate.c +259 -0
- package/deps/librdkafka/tests/0109-auto_create_topics.cpp +278 -0
- package/deps/librdkafka/tests/0110-batch_size.cpp +182 -0
- package/deps/librdkafka/tests/0111-delay_create_topics.cpp +127 -0
- package/deps/librdkafka/tests/0112-assign_unknown_part.c +87 -0
- package/deps/librdkafka/tests/0113-cooperative_rebalance.cpp +3473 -0
- package/deps/librdkafka/tests/0114-sticky_partitioning.cpp +176 -0
- package/deps/librdkafka/tests/0115-producer_auth.cpp +182 -0
- package/deps/librdkafka/tests/0116-kafkaconsumer_close.cpp +216 -0
- package/deps/librdkafka/tests/0117-mock_errors.c +331 -0
- package/deps/librdkafka/tests/0118-commit_rebalance.c +154 -0
- package/deps/librdkafka/tests/0119-consumer_auth.cpp +167 -0
- package/deps/librdkafka/tests/0120-asymmetric_subscription.c +185 -0
- package/deps/librdkafka/tests/0121-clusterid.c +115 -0
- package/deps/librdkafka/tests/0122-buffer_cleaning_after_rebalance.c +227 -0
- package/deps/librdkafka/tests/0123-connections_max_idle.c +98 -0
- package/deps/librdkafka/tests/0124-openssl_invalid_engine.c +69 -0
- package/deps/librdkafka/tests/0125-immediate_flush.c +144 -0
- package/deps/librdkafka/tests/0126-oauthbearer_oidc.c +528 -0
- package/deps/librdkafka/tests/0127-fetch_queue_backoff.cpp +165 -0
- package/deps/librdkafka/tests/0128-sasl_callback_queue.cpp +125 -0
- package/deps/librdkafka/tests/0129-fetch_aborted_msgs.c +79 -0
- package/deps/librdkafka/tests/0130-store_offsets.c +178 -0
- package/deps/librdkafka/tests/0131-connect_timeout.c +81 -0
- package/deps/librdkafka/tests/0132-strategy_ordering.c +179 -0
- package/deps/librdkafka/tests/0133-ssl_keys.c +150 -0
- package/deps/librdkafka/tests/0134-ssl_provider.c +92 -0
- package/deps/librdkafka/tests/0135-sasl_credentials.cpp +143 -0
- package/deps/librdkafka/tests/0136-resolve_cb.c +181 -0
- package/deps/librdkafka/tests/0137-barrier_batch_consume.c +619 -0
- package/deps/librdkafka/tests/0138-admin_mock.c +281 -0
- package/deps/librdkafka/tests/0139-offset_validation_mock.c +950 -0
- package/deps/librdkafka/tests/0140-commit_metadata.cpp +108 -0
- package/deps/librdkafka/tests/0142-reauthentication.c +515 -0
- package/deps/librdkafka/tests/0143-exponential_backoff_mock.c +552 -0
- package/deps/librdkafka/tests/0144-idempotence_mock.c +373 -0
- package/deps/librdkafka/tests/0145-pause_resume_mock.c +119 -0
- package/deps/librdkafka/tests/0146-metadata_mock.c +505 -0
- 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 +651 -0
- 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/1000-unktopic.c +164 -0
- package/deps/librdkafka/tests/8000-idle.cpp +60 -0
- package/deps/librdkafka/tests/8001-fetch_from_follower_mock_manual.c +113 -0
- package/deps/librdkafka/tests/CMakeLists.txt +170 -0
- package/deps/librdkafka/tests/LibrdkafkaTestApp.py +291 -0
- package/deps/librdkafka/tests/Makefile +182 -0
- package/deps/librdkafka/tests/README.md +509 -0
- package/deps/librdkafka/tests/autotest.sh +33 -0
- package/deps/librdkafka/tests/backtrace.gdb +30 -0
- package/deps/librdkafka/tests/broker_version_tests.py +315 -0
- package/deps/librdkafka/tests/buildbox.sh +17 -0
- package/deps/librdkafka/tests/cleanup-checker-tests.sh +20 -0
- package/deps/librdkafka/tests/cluster_testing.py +191 -0
- package/deps/librdkafka/tests/delete-test-topics.sh +56 -0
- package/deps/librdkafka/tests/fixtures/oauthbearer/jwt_assertion_template.json +10 -0
- package/deps/librdkafka/tests/fixtures/ssl/Makefile +8 -0
- package/deps/librdkafka/tests/fixtures/ssl/README.md +13 -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 +50 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.intermediate.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/create_keys.sh +168 -0
- package/deps/librdkafka/tests/fuzzers/Makefile +12 -0
- package/deps/librdkafka/tests/fuzzers/README.md +31 -0
- package/deps/librdkafka/tests/fuzzers/fuzz_regex.c +74 -0
- package/deps/librdkafka/tests/fuzzers/helpers.h +90 -0
- package/deps/librdkafka/tests/gen-ssl-certs.sh +165 -0
- package/deps/librdkafka/tests/interactive_broker_version.py +170 -0
- package/deps/librdkafka/tests/interceptor_test/CMakeLists.txt +16 -0
- package/deps/librdkafka/tests/interceptor_test/Makefile +22 -0
- package/deps/librdkafka/tests/interceptor_test/interceptor_test.c +314 -0
- package/deps/librdkafka/tests/interceptor_test/interceptor_test.h +54 -0
- package/deps/librdkafka/tests/java/IncrementalRebalanceCli.java +97 -0
- package/deps/librdkafka/tests/java/Makefile +13 -0
- package/deps/librdkafka/tests/java/Murmur2Cli.java +46 -0
- package/deps/librdkafka/tests/java/README.md +14 -0
- package/deps/librdkafka/tests/java/TransactionProducerCli.java +162 -0
- package/deps/librdkafka/tests/java/run-class.sh +11 -0
- package/deps/librdkafka/tests/librdkafka.suppressions +483 -0
- package/deps/librdkafka/tests/lz4_manual_test.sh +59 -0
- package/deps/librdkafka/tests/multi-broker-version-test.sh +50 -0
- package/deps/librdkafka/tests/parse-refcnt.sh +43 -0
- package/deps/librdkafka/tests/performance_plot.py +115 -0
- package/deps/librdkafka/tests/plugin_test/Makefile +19 -0
- package/deps/librdkafka/tests/plugin_test/plugin_test.c +58 -0
- package/deps/librdkafka/tests/requirements.txt +2 -0
- package/deps/librdkafka/tests/run-all-tests.sh +79 -0
- package/deps/librdkafka/tests/run-consumer-tests.sh +16 -0
- package/deps/librdkafka/tests/run-producer-tests.sh +16 -0
- package/deps/librdkafka/tests/run-test-batches.py +157 -0
- package/deps/librdkafka/tests/run-test.sh +140 -0
- package/deps/librdkafka/tests/rusage.c +249 -0
- package/deps/librdkafka/tests/sasl_test.py +289 -0
- package/deps/librdkafka/tests/scenarios/README.md +6 -0
- package/deps/librdkafka/tests/scenarios/ak23.json +6 -0
- package/deps/librdkafka/tests/scenarios/default.json +5 -0
- package/deps/librdkafka/tests/scenarios/noautocreate.json +5 -0
- package/deps/librdkafka/tests/sockem.c +801 -0
- package/deps/librdkafka/tests/sockem.h +85 -0
- package/deps/librdkafka/tests/sockem_ctrl.c +145 -0
- package/deps/librdkafka/tests/sockem_ctrl.h +61 -0
- package/deps/librdkafka/tests/test.c +7778 -0
- package/deps/librdkafka/tests/test.conf.example +27 -0
- package/deps/librdkafka/tests/test.h +1028 -0
- package/deps/librdkafka/tests/testcpp.cpp +131 -0
- package/deps/librdkafka/tests/testcpp.h +388 -0
- package/deps/librdkafka/tests/testshared.h +416 -0
- package/deps/librdkafka/tests/tools/README.md +4 -0
- package/deps/librdkafka/tests/tools/stats/README.md +21 -0
- package/deps/librdkafka/tests/tools/stats/filter.jq +42 -0
- package/deps/librdkafka/tests/tools/stats/graph.py +150 -0
- package/deps/librdkafka/tests/tools/stats/requirements.txt +3 -0
- package/deps/librdkafka/tests/tools/stats/to_csv.py +124 -0
- package/deps/librdkafka/tests/trivup/trivup-0.14.0.tar.gz +0 -0
- package/deps/librdkafka/tests/until-fail.sh +87 -0
- package/deps/librdkafka/tests/xxxx-assign_partition.c +122 -0
- package/deps/librdkafka/tests/xxxx-metadata.cpp +159 -0
- package/deps/librdkafka/vcpkg.json +23 -0
- package/deps/librdkafka/win32/README.md +5 -0
- package/deps/librdkafka/win32/build-package.bat +3 -0
- package/deps/librdkafka/win32/build.bat +19 -0
- package/deps/librdkafka/win32/common.vcxproj +84 -0
- package/deps/librdkafka/win32/interceptor_test/interceptor_test.vcxproj +87 -0
- package/deps/librdkafka/win32/librdkafka.autopkg.template +54 -0
- package/deps/librdkafka/win32/librdkafka.master.testing.targets +13 -0
- package/deps/librdkafka/win32/librdkafka.sln +226 -0
- package/deps/librdkafka/win32/librdkafka.vcxproj +276 -0
- package/deps/librdkafka/win32/librdkafkacpp/librdkafkacpp.vcxproj +104 -0
- package/deps/librdkafka/win32/msbuild.ps1 +15 -0
- package/deps/librdkafka/win32/openssl_engine_example/openssl_engine_example.vcxproj +132 -0
- package/deps/librdkafka/win32/package-zip.ps1 +46 -0
- package/deps/librdkafka/win32/packages/repositories.config +4 -0
- package/deps/librdkafka/win32/push-package.bat +4 -0
- package/deps/librdkafka/win32/rdkafka_complex_consumer_example_cpp/rdkafka_complex_consumer_example_cpp.vcxproj +67 -0
- package/deps/librdkafka/win32/rdkafka_example/rdkafka_example.vcxproj +97 -0
- package/deps/librdkafka/win32/rdkafka_performance/rdkafka_performance.vcxproj +97 -0
- package/deps/librdkafka/win32/setup-msys2.ps1 +47 -0
- package/deps/librdkafka/win32/setup-vcpkg.ps1 +34 -0
- package/deps/librdkafka/win32/tests/test.conf.example +25 -0
- package/deps/librdkafka/win32/tests/tests.vcxproj +253 -0
- package/deps/librdkafka/win32/win_ssl_cert_store/win_ssl_cert_store.vcxproj +132 -0
- package/deps/librdkafka/win32/wingetopt.c +564 -0
- package/deps/librdkafka/win32/wingetopt.h +101 -0
- package/deps/librdkafka/win32/wintime.h +33 -0
- package/deps/librdkafka.gyp +62 -0
- package/lib/admin.js +233 -0
- package/lib/client.js +573 -0
- package/lib/error.js +500 -0
- package/lib/index.js +34 -0
- package/lib/kafka-consumer-stream.js +397 -0
- package/lib/kafka-consumer.js +698 -0
- package/lib/producer/high-level-producer.js +323 -0
- package/lib/producer-stream.js +307 -0
- package/lib/producer.js +375 -0
- package/lib/tools/ref-counter.js +52 -0
- package/lib/topic-partition.js +88 -0
- package/lib/topic.js +42 -0
- package/lib/util.js +29 -0
- package/package.json +61 -0
- package/prebuilds/darwin-arm64/@point3+node-rdkafka.node +0 -0
- package/prebuilds/linux-x64/@point3+node-rdkafka.node +0 -0
- package/util/configure.js +30 -0
- package/util/get-env.js +6 -0
- package/util/test-compile.js +11 -0
- package/util/test-producer-delivery.js +100 -0
|
@@ -0,0 +1,836 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* librdkafka - Apache Kafka C library
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2019-2022, Magnus Edenhill
|
|
5
|
+
* 2025, Confluent Inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions are met:
|
|
10
|
+
*
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
12
|
+
* this list of conditions and the following disclaimer.
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
* and/or other materials provided with the distribution.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
20
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
21
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
22
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
23
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
24
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
25
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
26
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
27
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#include "test.h"
|
|
31
|
+
|
|
32
|
+
#include "../src/rdkafka_proto.h"
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @name KafkaConsumer static membership tests
|
|
36
|
+
*
|
|
37
|
+
* Runs two consumers subscribing to multiple topics simulating various
|
|
38
|
+
* rebalance scenarios with static group membership enabled.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
#define _CONSUMER_CNT 2
|
|
42
|
+
|
|
43
|
+
typedef struct _consumer_s {
|
|
44
|
+
rd_kafka_t *rk;
|
|
45
|
+
test_msgver_t *mv;
|
|
46
|
+
int64_t assigned_at;
|
|
47
|
+
int64_t revoked_at;
|
|
48
|
+
int partition_cnt;
|
|
49
|
+
rd_kafka_resp_err_t expected_rb_event;
|
|
50
|
+
int curr_line;
|
|
51
|
+
} _consumer_t;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @brief Call poll until a rebalance has been triggered
|
|
56
|
+
*/
|
|
57
|
+
static int static_member_wait_rebalance0(int line,
|
|
58
|
+
_consumer_t *c,
|
|
59
|
+
int64_t start,
|
|
60
|
+
int64_t *target,
|
|
61
|
+
int timeout_ms) {
|
|
62
|
+
int64_t tmout = test_clock() + (timeout_ms * 1000);
|
|
63
|
+
test_timing_t t_time;
|
|
64
|
+
|
|
65
|
+
c->curr_line = line;
|
|
66
|
+
|
|
67
|
+
TEST_SAY("line %d: %s awaiting %s event\n", line, rd_kafka_name(c->rk),
|
|
68
|
+
rd_kafka_err2name(c->expected_rb_event));
|
|
69
|
+
|
|
70
|
+
TIMING_START(&t_time, "wait_rebalance");
|
|
71
|
+
while (timeout_ms < 0 ? 1 : test_clock() <= tmout) {
|
|
72
|
+
if (*target > start) {
|
|
73
|
+
c->curr_line = 0;
|
|
74
|
+
return 1;
|
|
75
|
+
}
|
|
76
|
+
test_consumer_poll_once(c->rk, c->mv, 1000);
|
|
77
|
+
}
|
|
78
|
+
TIMING_STOP(&t_time);
|
|
79
|
+
|
|
80
|
+
c->curr_line = 0;
|
|
81
|
+
|
|
82
|
+
TEST_SAY("line %d: %s timed out awaiting %s event\n", line,
|
|
83
|
+
rd_kafka_name(c->rk), rd_kafka_err2name(c->expected_rb_event));
|
|
84
|
+
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#define static_member_expect_rebalance(C, START, TARGET, TIMEOUT_MS) \
|
|
89
|
+
do { \
|
|
90
|
+
if (!static_member_wait_rebalance0(__LINE__, C, START, TARGET, \
|
|
91
|
+
TIMEOUT_MS)) \
|
|
92
|
+
TEST_FAIL("%s: timed out waiting for %s event", \
|
|
93
|
+
rd_kafka_name((C)->rk), \
|
|
94
|
+
rd_kafka_err2name((C)->expected_rb_event)); \
|
|
95
|
+
} while (0)
|
|
96
|
+
|
|
97
|
+
#define static_member_wait_rebalance(C, START, TARGET, TIMEOUT_MS) \
|
|
98
|
+
static_member_wait_rebalance0(__LINE__, C, START, TARGET, TIMEOUT_MS)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
static void rebalance_cb(rd_kafka_t *rk,
|
|
102
|
+
rd_kafka_resp_err_t err,
|
|
103
|
+
rd_kafka_topic_partition_list_t *parts,
|
|
104
|
+
void *opaque) {
|
|
105
|
+
_consumer_t *c = opaque;
|
|
106
|
+
|
|
107
|
+
TEST_ASSERT(c->expected_rb_event == err,
|
|
108
|
+
"line %d: %s: Expected rebalance event %s got %s\n",
|
|
109
|
+
c->curr_line, rd_kafka_name(rk),
|
|
110
|
+
rd_kafka_err2name(c->expected_rb_event),
|
|
111
|
+
rd_kafka_err2name(err));
|
|
112
|
+
|
|
113
|
+
switch (err) {
|
|
114
|
+
case RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS:
|
|
115
|
+
TEST_SAY("line %d: %s Assignment (%d partition(s)):\n",
|
|
116
|
+
c->curr_line, rd_kafka_name(rk), parts->cnt);
|
|
117
|
+
test_print_partition_list(parts);
|
|
118
|
+
|
|
119
|
+
c->partition_cnt = parts->cnt;
|
|
120
|
+
c->assigned_at = test_clock();
|
|
121
|
+
rd_kafka_assign(rk, parts);
|
|
122
|
+
|
|
123
|
+
break;
|
|
124
|
+
|
|
125
|
+
case RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS:
|
|
126
|
+
c->revoked_at = test_clock();
|
|
127
|
+
rd_kafka_assign(rk, NULL);
|
|
128
|
+
TEST_SAY("line %d: %s revoked %d partitions\n", c->curr_line,
|
|
129
|
+
rd_kafka_name(c->rk), parts->cnt);
|
|
130
|
+
|
|
131
|
+
break;
|
|
132
|
+
|
|
133
|
+
default:
|
|
134
|
+
TEST_FAIL("rebalance failed: %s", rd_kafka_err2str(err));
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Reset error */
|
|
139
|
+
c->expected_rb_event = RD_KAFKA_RESP_ERR_NO_ERROR;
|
|
140
|
+
|
|
141
|
+
/* prevent poll from triggering more than one rebalance event */
|
|
142
|
+
rd_kafka_yield(rk);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
static void do_test_static_group_rebalance(void) {
|
|
147
|
+
rd_kafka_conf_t *conf;
|
|
148
|
+
test_msgver_t mv;
|
|
149
|
+
int64_t rebalance_start;
|
|
150
|
+
_consumer_t c[_CONSUMER_CNT] = RD_ZERO_INIT;
|
|
151
|
+
const int msgcnt = 100;
|
|
152
|
+
uint64_t testid = test_id_generate();
|
|
153
|
+
const char *topic =
|
|
154
|
+
test_mk_topic_name("0102_static_group_rebalance", 1);
|
|
155
|
+
char *topics = rd_strdup(tsprintf("^%s.*", topic));
|
|
156
|
+
test_timing_t t_close;
|
|
157
|
+
|
|
158
|
+
SUB_TEST();
|
|
159
|
+
|
|
160
|
+
test_conf_init(&conf, NULL, 70);
|
|
161
|
+
test_msgver_init(&mv, testid);
|
|
162
|
+
c[0].mv = &mv;
|
|
163
|
+
c[1].mv = &mv;
|
|
164
|
+
|
|
165
|
+
test_create_topic_wait_exists(NULL, topic, 3, 1, 5000);
|
|
166
|
+
test_produce_msgs_easy(topic, testid, RD_KAFKA_PARTITION_UA, msgcnt);
|
|
167
|
+
|
|
168
|
+
test_conf_set(conf, "max.poll.interval.ms", "9000");
|
|
169
|
+
test_conf_set(conf, "session.timeout.ms", "6000");
|
|
170
|
+
test_conf_set(conf, "auto.offset.reset", "earliest");
|
|
171
|
+
/* Keep this interval higher than cluster metadata propagation
|
|
172
|
+
* time to make sure no additional rebalances are triggered
|
|
173
|
+
* when refreshing the full metadata with a regex subscription. */
|
|
174
|
+
test_conf_set(conf, "topic.metadata.refresh.interval.ms", "2000");
|
|
175
|
+
test_conf_set(conf, "metadata.max.age.ms", "5000");
|
|
176
|
+
test_conf_set(conf, "enable.partition.eof", "true");
|
|
177
|
+
test_conf_set(conf, "group.instance.id", "consumer1");
|
|
178
|
+
|
|
179
|
+
rd_kafka_conf_set_opaque(conf, &c[0]);
|
|
180
|
+
c[0].rk = test_create_consumer(topic, rebalance_cb,
|
|
181
|
+
rd_kafka_conf_dup(conf), NULL);
|
|
182
|
+
|
|
183
|
+
rd_kafka_conf_set_opaque(conf, &c[1]);
|
|
184
|
+
test_conf_set(conf, "group.instance.id", "consumer2");
|
|
185
|
+
c[1].rk = test_create_consumer(topic, rebalance_cb,
|
|
186
|
+
rd_kafka_conf_dup(conf), NULL);
|
|
187
|
+
|
|
188
|
+
test_wait_topic_exists(c[1].rk, topic, 5000);
|
|
189
|
+
|
|
190
|
+
test_consumer_subscribe(c[0].rk, topics);
|
|
191
|
+
test_consumer_subscribe(c[1].rk, topics);
|
|
192
|
+
|
|
193
|
+
/*
|
|
194
|
+
* Static members enforce `max.poll.interval.ms` which may prompt
|
|
195
|
+
* an unwanted rebalance while the other consumer awaits its assignment.
|
|
196
|
+
* These members remain in the member list however so we must
|
|
197
|
+
* interleave calls to poll while awaiting our assignment to avoid
|
|
198
|
+
* unexpected rebalances being triggered.
|
|
199
|
+
*/
|
|
200
|
+
rebalance_start = test_clock();
|
|
201
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
202
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
203
|
+
while (!static_member_wait_rebalance(&c[0], rebalance_start,
|
|
204
|
+
&c[0].assigned_at, 1000)) {
|
|
205
|
+
/* keep consumer 2 alive while consumer 1 awaits
|
|
206
|
+
* its assignment
|
|
207
|
+
*/
|
|
208
|
+
c[1].curr_line = __LINE__;
|
|
209
|
+
test_consumer_poll_once(c[1].rk, &mv, 0);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
static_member_expect_rebalance(&c[1], rebalance_start,
|
|
213
|
+
&c[1].assigned_at, -1);
|
|
214
|
+
|
|
215
|
+
/*
|
|
216
|
+
* Consume all the messages so we can watch for duplicates
|
|
217
|
+
* after rejoin/rebalance operations.
|
|
218
|
+
*/
|
|
219
|
+
c[0].curr_line = __LINE__;
|
|
220
|
+
test_consumer_poll("serve.queue", c[0].rk, testid, c[0].partition_cnt,
|
|
221
|
+
0, -1, &mv);
|
|
222
|
+
c[1].curr_line = __LINE__;
|
|
223
|
+
test_consumer_poll("serve.queue", c[1].rk, testid, c[1].partition_cnt,
|
|
224
|
+
0, -1, &mv);
|
|
225
|
+
|
|
226
|
+
test_msgver_verify("first.verify", &mv, TEST_MSGVER_ALL, 0, msgcnt);
|
|
227
|
+
|
|
228
|
+
TEST_SAY("== Testing consumer restart ==\n");
|
|
229
|
+
|
|
230
|
+
/* Only c[1] should exhibit rebalance behavior */
|
|
231
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
232
|
+
TIMING_START(&t_close, "consumer restart");
|
|
233
|
+
test_consumer_close(c[1].rk);
|
|
234
|
+
rd_kafka_destroy(c[1].rk);
|
|
235
|
+
c[1].rk = test_create_consumer(topic, rebalance_cb,
|
|
236
|
+
rd_kafka_conf_dup(conf), NULL);
|
|
237
|
+
rd_kafka_conf_destroy(conf);
|
|
238
|
+
rd_kafka_poll_set_consumer(c[1].rk);
|
|
239
|
+
|
|
240
|
+
test_consumer_subscribe(c[1].rk, topics);
|
|
241
|
+
|
|
242
|
+
/* Await assignment */
|
|
243
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
244
|
+
rebalance_start = test_clock();
|
|
245
|
+
while (!static_member_wait_rebalance(&c[1], rebalance_start,
|
|
246
|
+
&c[1].assigned_at, 1000)) {
|
|
247
|
+
c[0].curr_line = __LINE__;
|
|
248
|
+
test_consumer_poll_once(c[0].rk, &mv, 0);
|
|
249
|
+
}
|
|
250
|
+
TIMING_STOP(&t_close);
|
|
251
|
+
|
|
252
|
+
/* Should complete before `session.timeout.ms` */
|
|
253
|
+
TIMING_ASSERT(&t_close, 0, 6000);
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
TEST_SAY("== Testing subscription expansion ==\n");
|
|
257
|
+
|
|
258
|
+
/*
|
|
259
|
+
* New topics matching the subscription pattern should cause
|
|
260
|
+
* group rebalance
|
|
261
|
+
*/
|
|
262
|
+
test_create_topic_wait_exists(c->rk, tsprintf("%snew", topic), 1, 1,
|
|
263
|
+
5000);
|
|
264
|
+
|
|
265
|
+
/* Await revocation */
|
|
266
|
+
rebalance_start = test_clock();
|
|
267
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
268
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
269
|
+
while (!static_member_wait_rebalance(&c[0], rebalance_start,
|
|
270
|
+
&c[0].revoked_at, 1000)) {
|
|
271
|
+
c[1].curr_line = __LINE__;
|
|
272
|
+
test_consumer_poll_once(c[1].rk, &mv, 0);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
static_member_expect_rebalance(&c[1], rebalance_start, &c[1].revoked_at,
|
|
276
|
+
-1);
|
|
277
|
+
|
|
278
|
+
/* Await assignment */
|
|
279
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
280
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
281
|
+
while (!static_member_wait_rebalance(&c[0], rebalance_start,
|
|
282
|
+
&c[0].assigned_at, 1000)) {
|
|
283
|
+
c[1].curr_line = __LINE__;
|
|
284
|
+
test_consumer_poll_once(c[1].rk, &mv, 0);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
static_member_expect_rebalance(&c[1], rebalance_start,
|
|
288
|
+
&c[1].assigned_at, -1);
|
|
289
|
+
|
|
290
|
+
TEST_SAY("== Testing consumer unsubscribe ==\n");
|
|
291
|
+
|
|
292
|
+
/* Unsubscribe should send a LeaveGroupRequest invoking a rebalance */
|
|
293
|
+
|
|
294
|
+
/* Send LeaveGroup incrementing generation by 1 */
|
|
295
|
+
rebalance_start = test_clock();
|
|
296
|
+
rd_kafka_unsubscribe(c[1].rk);
|
|
297
|
+
|
|
298
|
+
/* Await revocation */
|
|
299
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
300
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
301
|
+
static_member_expect_rebalance(&c[1], rebalance_start, &c[1].revoked_at,
|
|
302
|
+
-1);
|
|
303
|
+
static_member_expect_rebalance(&c[0], rebalance_start, &c[0].revoked_at,
|
|
304
|
+
-1);
|
|
305
|
+
|
|
306
|
+
/* New cgrp generation with 1 member, c[0] */
|
|
307
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
308
|
+
static_member_expect_rebalance(&c[0], rebalance_start,
|
|
309
|
+
&c[0].assigned_at, -1);
|
|
310
|
+
|
|
311
|
+
/* Send JoinGroup bumping generation by 1 */
|
|
312
|
+
rebalance_start = test_clock();
|
|
313
|
+
test_consumer_subscribe(c[1].rk, topics);
|
|
314
|
+
|
|
315
|
+
/* End previous single member generation */
|
|
316
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
317
|
+
static_member_expect_rebalance(&c[0], rebalance_start, &c[0].revoked_at,
|
|
318
|
+
-1);
|
|
319
|
+
|
|
320
|
+
/* Await assignment */
|
|
321
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
322
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
323
|
+
while (!static_member_wait_rebalance(&c[1], rebalance_start,
|
|
324
|
+
&c[1].assigned_at, 1000)) {
|
|
325
|
+
c[0].curr_line = __LINE__;
|
|
326
|
+
test_consumer_poll_once(c[0].rk, &mv, 0);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
static_member_expect_rebalance(&c[0], rebalance_start,
|
|
330
|
+
&c[0].assigned_at, -1);
|
|
331
|
+
|
|
332
|
+
TEST_SAY("== Testing max poll violation ==\n");
|
|
333
|
+
/* max.poll.interval.ms should still be enforced by the consumer */
|
|
334
|
+
|
|
335
|
+
/*
|
|
336
|
+
* Stop polling consumer 2 until we reach
|
|
337
|
+
* `max.poll.interval.ms` and is evicted from the group.
|
|
338
|
+
*/
|
|
339
|
+
rebalance_start = test_clock();
|
|
340
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
341
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
342
|
+
c[0].curr_line = __LINE__;
|
|
343
|
+
/* consumer 2 will time out and all partitions will be assigned to
|
|
344
|
+
* consumer 1. */
|
|
345
|
+
static_member_expect_rebalance(&c[0], rebalance_start, &c[0].revoked_at,
|
|
346
|
+
-1);
|
|
347
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
348
|
+
static_member_expect_rebalance(&c[0], rebalance_start,
|
|
349
|
+
&c[0].assigned_at, -1);
|
|
350
|
+
|
|
351
|
+
/* consumer 2 restarts polling and re-joins the group */
|
|
352
|
+
rebalance_start = test_clock();
|
|
353
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
354
|
+
c[1].curr_line = __LINE__;
|
|
355
|
+
test_consumer_poll_expect_err(c[1].rk, testid, 1000,
|
|
356
|
+
RD_KAFKA_RESP_ERR__MAX_POLL_EXCEEDED);
|
|
357
|
+
|
|
358
|
+
/* Await revocation */
|
|
359
|
+
while (!static_member_wait_rebalance(&c[0], rebalance_start,
|
|
360
|
+
&c[0].revoked_at, 1000)) {
|
|
361
|
+
c[1].curr_line = __LINE__;
|
|
362
|
+
test_consumer_poll_once(c[1].rk, &mv, 0);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
static_member_expect_rebalance(&c[1], rebalance_start, &c[1].revoked_at,
|
|
366
|
+
-1);
|
|
367
|
+
|
|
368
|
+
/* Await assignment */
|
|
369
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
370
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
371
|
+
while (!static_member_wait_rebalance(&c[1], rebalance_start,
|
|
372
|
+
&c[1].assigned_at, 1000)) {
|
|
373
|
+
c[0].curr_line = __LINE__;
|
|
374
|
+
test_consumer_poll_once(c[0].rk, &mv, 0);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
static_member_expect_rebalance(&c[0], rebalance_start,
|
|
378
|
+
&c[0].assigned_at, -1);
|
|
379
|
+
|
|
380
|
+
TEST_SAY("== Testing `session.timeout.ms` member eviction ==\n");
|
|
381
|
+
|
|
382
|
+
rebalance_start = test_clock();
|
|
383
|
+
c[0].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
384
|
+
TIMING_START(&t_close, "consumer close");
|
|
385
|
+
test_consumer_close(c[0].rk);
|
|
386
|
+
rd_kafka_destroy(c[0].rk);
|
|
387
|
+
|
|
388
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
389
|
+
static_member_expect_rebalance(&c[1], rebalance_start, &c[1].revoked_at,
|
|
390
|
+
2 * 7000);
|
|
391
|
+
|
|
392
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
393
|
+
static_member_expect_rebalance(&c[1], rebalance_start,
|
|
394
|
+
&c[1].assigned_at, 2000);
|
|
395
|
+
|
|
396
|
+
/* Should take at least as long as `session.timeout.ms` but less than
|
|
397
|
+
* `max.poll.interval.ms`, but since we can't really know when
|
|
398
|
+
* the last Heartbeat or SyncGroup request was sent we need to
|
|
399
|
+
* allow some leeway on the minimum side (4s), and also some on
|
|
400
|
+
* the maximum side (1s) for slow runtimes. */
|
|
401
|
+
TIMING_ASSERT(&t_close, 6000 - 4000, 9000 + 1000);
|
|
402
|
+
|
|
403
|
+
c[1].expected_rb_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
404
|
+
test_consumer_close(c[1].rk);
|
|
405
|
+
rd_kafka_destroy(c[1].rk);
|
|
406
|
+
|
|
407
|
+
test_msgver_verify("final.validation", &mv, TEST_MSGVER_ALL, 0, msgcnt);
|
|
408
|
+
test_msgver_clear(&mv);
|
|
409
|
+
free(topics);
|
|
410
|
+
|
|
411
|
+
SUB_TEST_PASS();
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* @brief Await a non-empty assignment for all consumers in \p c
|
|
417
|
+
*/
|
|
418
|
+
static void await_assignment_multi(const char *what, rd_kafka_t **c, int cnt) {
|
|
419
|
+
rd_kafka_topic_partition_list_t *parts;
|
|
420
|
+
int assignment_cnt;
|
|
421
|
+
|
|
422
|
+
TEST_SAY("%s\n", what);
|
|
423
|
+
|
|
424
|
+
do {
|
|
425
|
+
int i;
|
|
426
|
+
int timeout_ms = 1000;
|
|
427
|
+
|
|
428
|
+
assignment_cnt = 0;
|
|
429
|
+
|
|
430
|
+
for (i = 0; i < cnt; i++) {
|
|
431
|
+
test_consumer_poll_no_msgs("poll", c[i], 0, timeout_ms);
|
|
432
|
+
timeout_ms = 100;
|
|
433
|
+
|
|
434
|
+
if (!rd_kafka_assignment(c[i], &parts) && parts) {
|
|
435
|
+
TEST_SAY("%s has %d partition(s) assigned\n",
|
|
436
|
+
rd_kafka_name(c[i]), parts->cnt);
|
|
437
|
+
if (parts->cnt > 0)
|
|
438
|
+
assignment_cnt++;
|
|
439
|
+
rd_kafka_topic_partition_list_destroy(parts);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
} while (assignment_cnt < cnt);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
static const rd_kafka_t *valid_fatal_rk;
|
|
448
|
+
/**
|
|
449
|
+
* @brief Tells test harness that fatal error should not fail the current test
|
|
450
|
+
*/
|
|
451
|
+
static int
|
|
452
|
+
is_fatal_cb(rd_kafka_t *rk, rd_kafka_resp_err_t err, const char *reason) {
|
|
453
|
+
return rk != valid_fatal_rk;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* @brief Test that consumer fencing raises a fatal error, classic protocol
|
|
458
|
+
*/
|
|
459
|
+
static void do_test_fenced_member_classic(void) {
|
|
460
|
+
rd_kafka_t *c[3]; /* 0: consumer2b, 1: consumer1, 2: consumer2a */
|
|
461
|
+
rd_kafka_conf_t *conf;
|
|
462
|
+
const char *topic =
|
|
463
|
+
test_mk_topic_name("0102_static_group_rebalance", 1);
|
|
464
|
+
rd_kafka_message_t *rkm;
|
|
465
|
+
char errstr[512];
|
|
466
|
+
rd_kafka_resp_err_t err;
|
|
467
|
+
|
|
468
|
+
SUB_TEST();
|
|
469
|
+
|
|
470
|
+
test_conf_init(&conf, NULL, 30);
|
|
471
|
+
|
|
472
|
+
test_create_topic(NULL, topic, 3, 1);
|
|
473
|
+
|
|
474
|
+
test_conf_set(conf, "group.instance.id", "consumer1");
|
|
475
|
+
test_conf_set(conf, "client.id", "consumer1");
|
|
476
|
+
c[1] = test_create_consumer(topic, NULL, rd_kafka_conf_dup(conf), NULL);
|
|
477
|
+
|
|
478
|
+
test_conf_set(conf, "group.instance.id", "consumer2");
|
|
479
|
+
test_conf_set(conf, "client.id", "consumer2a");
|
|
480
|
+
c[2] = test_create_consumer(topic, NULL, rd_kafka_conf_dup(conf), NULL);
|
|
481
|
+
|
|
482
|
+
test_wait_topic_exists(c[2], topic, 5000);
|
|
483
|
+
|
|
484
|
+
test_consumer_subscribe(c[1], topic);
|
|
485
|
+
test_consumer_subscribe(c[2], topic);
|
|
486
|
+
|
|
487
|
+
await_assignment_multi("Awaiting initial assignments", &c[1], 2);
|
|
488
|
+
|
|
489
|
+
/* Create conflicting consumer */
|
|
490
|
+
TEST_SAY("Creating conflicting consumer2 instance\n");
|
|
491
|
+
test_conf_set(conf, "group.instance.id", "consumer2");
|
|
492
|
+
test_conf_set(conf, "client.id", "consumer2b");
|
|
493
|
+
c[0] = test_create_consumer(topic, NULL, rd_kafka_conf_dup(conf), NULL);
|
|
494
|
+
rd_kafka_conf_destroy(conf);
|
|
495
|
+
|
|
496
|
+
test_curr->is_fatal_cb = is_fatal_cb;
|
|
497
|
+
valid_fatal_rk = c[2]; /* consumer2a is the consumer that should fail */
|
|
498
|
+
|
|
499
|
+
test_consumer_subscribe(c[0], topic);
|
|
500
|
+
|
|
501
|
+
/* consumer1 should not be affected (other than a rebalance which
|
|
502
|
+
* we ignore here)... */
|
|
503
|
+
test_consumer_poll_no_msgs("consumer1", c[1], 0, 5000);
|
|
504
|
+
|
|
505
|
+
/* .. but consumer2a should now have been fenced off by consumer2b */
|
|
506
|
+
rkm = rd_kafka_consumer_poll(c[2], 5000);
|
|
507
|
+
TEST_ASSERT(rkm != NULL, "Expected error, not timeout");
|
|
508
|
+
TEST_ASSERT(rkm->err == RD_KAFKA_RESP_ERR__FATAL,
|
|
509
|
+
"Expected ERR__FATAL, not %s: %s",
|
|
510
|
+
rd_kafka_err2str(rkm->err), rd_kafka_message_errstr(rkm));
|
|
511
|
+
TEST_SAY("Fenced consumer returned expected: %s: %s\n",
|
|
512
|
+
rd_kafka_err2name(rkm->err), rd_kafka_message_errstr(rkm));
|
|
513
|
+
rd_kafka_message_destroy(rkm);
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
/* Read the actual error */
|
|
517
|
+
err = rd_kafka_fatal_error(c[2], errstr, sizeof(errstr));
|
|
518
|
+
TEST_SAY("%s fatal error: %s: %s\n", rd_kafka_name(c[2]),
|
|
519
|
+
rd_kafka_err2name(err), errstr);
|
|
520
|
+
TEST_ASSERT(err == RD_KAFKA_RESP_ERR_FENCED_INSTANCE_ID,
|
|
521
|
+
"Expected ERR_FENCED_INSTANCE_ID as fatal error, not %s",
|
|
522
|
+
rd_kafka_err2name(err));
|
|
523
|
+
|
|
524
|
+
TEST_SAY("close\n");
|
|
525
|
+
/* Close consumer2a, should also return a fatal error */
|
|
526
|
+
err = rd_kafka_consumer_close(c[2]);
|
|
527
|
+
TEST_ASSERT(err == RD_KAFKA_RESP_ERR__FATAL,
|
|
528
|
+
"Expected close on %s to return ERR__FATAL, not %s",
|
|
529
|
+
rd_kafka_name(c[2]), rd_kafka_err2name(err));
|
|
530
|
+
|
|
531
|
+
rd_kafka_destroy(c[2]);
|
|
532
|
+
|
|
533
|
+
/* consumer2b and consumer1 should be fine and get their
|
|
534
|
+
* assignments */
|
|
535
|
+
await_assignment_multi("Awaiting post-fencing assignment", c, 2);
|
|
536
|
+
|
|
537
|
+
rd_kafka_destroy(c[0]);
|
|
538
|
+
rd_kafka_destroy(c[1]);
|
|
539
|
+
|
|
540
|
+
SUB_TEST_PASS();
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* @brief Test that consumer fencing raises a fatal error,
|
|
545
|
+
* consumer protocol (KIP-848).
|
|
546
|
+
* The difference with the behavior of the classic one is that
|
|
547
|
+
* the member that is fenced is the one that is joining the group
|
|
548
|
+
* and not the one that was already in the group.
|
|
549
|
+
* Also the error is ERR_UNRELEASED_INSTANCE_ID instead of
|
|
550
|
+
* ERR_FENCED_INSTANCE_ID.
|
|
551
|
+
*/
|
|
552
|
+
static void do_test_fenced_member_consumer(void) {
|
|
553
|
+
rd_kafka_t *c[3]; /* 0: consumer2b, 1: consumer1, 2: consumer2a */
|
|
554
|
+
rd_kafka_conf_t *conf;
|
|
555
|
+
const char *topic =
|
|
556
|
+
test_mk_topic_name("0102_static_group_rebalance", 1);
|
|
557
|
+
rd_kafka_message_t *rkm;
|
|
558
|
+
char errstr[512];
|
|
559
|
+
rd_kafka_resp_err_t err;
|
|
560
|
+
|
|
561
|
+
SUB_TEST();
|
|
562
|
+
|
|
563
|
+
test_conf_init(&conf, NULL, 30);
|
|
564
|
+
|
|
565
|
+
test_create_topic(NULL, topic, 3, 1);
|
|
566
|
+
|
|
567
|
+
test_conf_set(conf, "group.instance.id", "consumer1");
|
|
568
|
+
test_conf_set(conf, "client.id", "consumer1");
|
|
569
|
+
c[1] = test_create_consumer(topic, NULL, rd_kafka_conf_dup(conf), NULL);
|
|
570
|
+
|
|
571
|
+
test_conf_set(conf, "group.instance.id", "consumer2");
|
|
572
|
+
test_conf_set(conf, "client.id", "consumer2a");
|
|
573
|
+
c[2] = test_create_consumer(topic, NULL, rd_kafka_conf_dup(conf), NULL);
|
|
574
|
+
|
|
575
|
+
test_wait_topic_exists(c[2], topic, 5000);
|
|
576
|
+
|
|
577
|
+
test_consumer_subscribe(c[1], topic);
|
|
578
|
+
test_consumer_subscribe(c[2], topic);
|
|
579
|
+
|
|
580
|
+
await_assignment_multi("Awaiting initial assignments", &c[1], 2);
|
|
581
|
+
|
|
582
|
+
/* Create conflicting consumer */
|
|
583
|
+
TEST_SAY("Creating conflicting consumer 2 instance\n");
|
|
584
|
+
test_conf_set(conf, "group.instance.id", "consumer2");
|
|
585
|
+
test_conf_set(conf, "client.id", "consumer2b");
|
|
586
|
+
c[0] = test_create_consumer(topic, NULL, rd_kafka_conf_dup(conf), NULL);
|
|
587
|
+
rd_kafka_conf_destroy(conf);
|
|
588
|
+
|
|
589
|
+
test_curr->is_fatal_cb = is_fatal_cb;
|
|
590
|
+
valid_fatal_rk = c[0]; /* consumer2b is the consumer that should fail */
|
|
591
|
+
|
|
592
|
+
test_consumer_subscribe(c[0], topic);
|
|
593
|
+
|
|
594
|
+
/* consumer1 should not be affected (other than a rebalance which
|
|
595
|
+
* we ignore here)... */
|
|
596
|
+
test_consumer_poll_no_msgs("consumer1", c[1], 0, 5000);
|
|
597
|
+
|
|
598
|
+
/* consumer2b should be fenced off on joining */
|
|
599
|
+
rkm = rd_kafka_consumer_poll(c[0], 5000);
|
|
600
|
+
TEST_ASSERT(rkm != NULL, "Expected error, not timeout");
|
|
601
|
+
TEST_ASSERT(rkm->err == RD_KAFKA_RESP_ERR__FATAL,
|
|
602
|
+
"Expected ERR__FATAL, not %s: %s",
|
|
603
|
+
rd_kafka_err2str(rkm->err), rd_kafka_message_errstr(rkm));
|
|
604
|
+
TEST_SAY("Fenced consumer returned expected: %s: %s\n",
|
|
605
|
+
rd_kafka_err2name(rkm->err), rd_kafka_message_errstr(rkm));
|
|
606
|
+
rd_kafka_message_destroy(rkm);
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
/* Read the actual error */
|
|
610
|
+
err = rd_kafka_fatal_error(c[0], errstr, sizeof(errstr));
|
|
611
|
+
TEST_SAY("%s fatal error: %s: %s\n", rd_kafka_name(c[0]),
|
|
612
|
+
rd_kafka_err2name(err), errstr);
|
|
613
|
+
TEST_ASSERT(
|
|
614
|
+
err == RD_KAFKA_RESP_ERR_UNRELEASED_INSTANCE_ID,
|
|
615
|
+
"Expected ERR_UNRELEASED_INSTANCE_ID as fatal error, not %s",
|
|
616
|
+
rd_kafka_err2name(err));
|
|
617
|
+
|
|
618
|
+
TEST_SAY("close\n");
|
|
619
|
+
/* Close consumer2b, should also return a fatal error */
|
|
620
|
+
err = rd_kafka_consumer_close(c[0]);
|
|
621
|
+
TEST_ASSERT(err == RD_KAFKA_RESP_ERR__FATAL,
|
|
622
|
+
"Expected close on %s to return ERR__FATAL, not %s",
|
|
623
|
+
rd_kafka_name(c[0]), rd_kafka_err2name(err));
|
|
624
|
+
|
|
625
|
+
rd_kafka_destroy(c[0]);
|
|
626
|
+
|
|
627
|
+
/* consumer1 and consumer2a should be fine and get their
|
|
628
|
+
* assignments */
|
|
629
|
+
await_assignment_multi("Awaiting post-fencing assignment", &c[1], 2);
|
|
630
|
+
|
|
631
|
+
rd_kafka_destroy(c[1]);
|
|
632
|
+
rd_kafka_destroy(c[2]);
|
|
633
|
+
|
|
634
|
+
SUB_TEST_PASS();
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* @brief Create a new consumer with given \p boostraps
|
|
638
|
+
* \p group_id and \p group_instance_id .
|
|
639
|
+
*/
|
|
640
|
+
static rd_kafka_t *create_consumer(const char *bootstraps,
|
|
641
|
+
const char *group_id,
|
|
642
|
+
const char *group_instance_id) {
|
|
643
|
+
rd_kafka_conf_t *conf;
|
|
644
|
+
test_conf_init(&conf, NULL, 0);
|
|
645
|
+
test_conf_set(conf, "bootstrap.servers", bootstraps);
|
|
646
|
+
test_conf_set(conf, "group.instance.id", group_instance_id);
|
|
647
|
+
test_conf_set(conf, "auto.offset.reset", "earliest");
|
|
648
|
+
test_conf_set(conf, "enable.partition.eof", "true");
|
|
649
|
+
return test_create_consumer(group_id, NULL, conf, NULL);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* @brief Get generation id of consumer \p consumer .
|
|
654
|
+
*/
|
|
655
|
+
static int32_t consumer_generation_id(rd_kafka_t *consumer) {
|
|
656
|
+
rd_kafka_consumer_group_metadata_t *group_metadata;
|
|
657
|
+
int32_t generation_id;
|
|
658
|
+
|
|
659
|
+
group_metadata = rd_kafka_consumer_group_metadata(consumer);
|
|
660
|
+
generation_id =
|
|
661
|
+
rd_kafka_consumer_group_metadata_generation_id(group_metadata);
|
|
662
|
+
rd_kafka_consumer_group_metadata_destroy(group_metadata);
|
|
663
|
+
return generation_id;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* @brief Check if the API key in \p request is the same as that
|
|
668
|
+
* pointed by \p opaque .
|
|
669
|
+
*/
|
|
670
|
+
static rd_bool_t is_api_key(rd_kafka_mock_request_t *request, void *opaque) {
|
|
671
|
+
int32_t api_key = *(int32_t *)opaque;
|
|
672
|
+
return rd_kafka_mock_request_api_key(request) == api_key;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* @enum do_test_static_membership_mock_variation_t
|
|
677
|
+
* @brief Variations of the static membership mock test.
|
|
678
|
+
*/
|
|
679
|
+
typedef enum do_test_static_membership_mock_variation_t {
|
|
680
|
+
/** Consumer 1 leaves with unsubscribe and rejoins the group */
|
|
681
|
+
DO_TEST_STATIC_MEMBERSHIP_MOCK_VARIATION_SAME_INSTANCE = 0,
|
|
682
|
+
/** Consumer 1 leaves with unsubscribe and a new consumer with same
|
|
683
|
+
* group.instance.id joins the group */
|
|
684
|
+
DO_TEST_STATIC_MEMBERSHIP_MOCK_VARIATION_NEW_INSTANCE = 1,
|
|
685
|
+
DO_TEST_STATIC_MEMBERSHIP_MOCK_VARIATION__CNT
|
|
686
|
+
} do_test_static_membership_mock_variation_t;
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* @brief Static group membership tests with the mock cluster.
|
|
690
|
+
* Checks that consumer returns the same assignment
|
|
691
|
+
* and generation id after re-joining.
|
|
692
|
+
*
|
|
693
|
+
* @param variation Test variation to run.
|
|
694
|
+
*
|
|
695
|
+
* @sa `do_test_static_membership_mock_variation_t`
|
|
696
|
+
*/
|
|
697
|
+
static void do_test_static_membership_mock(
|
|
698
|
+
do_test_static_membership_mock_variation_t variation) {
|
|
699
|
+
const char *bootstraps;
|
|
700
|
+
rd_kafka_mock_cluster_t *mcluster;
|
|
701
|
+
int32_t api_key = RD_KAFKAP_ConsumerGroupHeartbeat;
|
|
702
|
+
const char *topic = test_mk_topic_name(__FUNCTION__, 0);
|
|
703
|
+
rd_kafka_t *consumer1, *consumer2, *consumer_1_to_destroy = NULL;
|
|
704
|
+
int32_t prev_generation_id1, next_generation_id1, prev_generation_id2,
|
|
705
|
+
next_generation_id2;
|
|
706
|
+
rd_kafka_topic_partition_list_t *prev_assignment1, *prev_assignment2,
|
|
707
|
+
*next_assignment1, *next_assignment2;
|
|
708
|
+
|
|
709
|
+
SUB_TEST_QUICK(
|
|
710
|
+
"%s",
|
|
711
|
+
variation == DO_TEST_STATIC_MEMBERSHIP_MOCK_VARIATION_SAME_INSTANCE
|
|
712
|
+
? "with same instance"
|
|
713
|
+
: "with new instance");
|
|
714
|
+
|
|
715
|
+
mcluster = test_mock_cluster_new(3, &bootstraps);
|
|
716
|
+
rd_kafka_mock_topic_create(mcluster, topic, 2, 3);
|
|
717
|
+
|
|
718
|
+
TEST_SAY("Creating consumers\n");
|
|
719
|
+
consumer1 = create_consumer(bootstraps, topic, "c1");
|
|
720
|
+
consumer2 = create_consumer(bootstraps, topic, "c2");
|
|
721
|
+
|
|
722
|
+
TEST_SAY("Subscribing consumers to topic \"%s\"\n", topic);
|
|
723
|
+
test_consumer_subscribe(consumer1, topic);
|
|
724
|
+
test_consumer_subscribe(consumer2, topic);
|
|
725
|
+
|
|
726
|
+
TEST_SAY("Waiting one EOF of consumer 1\n");
|
|
727
|
+
test_consumer_poll_exact("first consumer", consumer1, 0, 1, 0, 0,
|
|
728
|
+
rd_true, NULL);
|
|
729
|
+
TEST_SAY("Waiting one EOF of consumer 2\n");
|
|
730
|
+
test_consumer_poll_exact("second consumer", consumer2, 0, 1, 0, 0,
|
|
731
|
+
rd_true, NULL);
|
|
732
|
+
|
|
733
|
+
prev_generation_id1 = consumer_generation_id(consumer1);
|
|
734
|
+
prev_generation_id2 = consumer_generation_id(consumer2);
|
|
735
|
+
TEST_CALL_ERR__(rd_kafka_assignment(consumer1, &prev_assignment1));
|
|
736
|
+
TEST_CALL_ERR__(rd_kafka_assignment(consumer2, &prev_assignment2));
|
|
737
|
+
TEST_ASSERT(prev_assignment1 != NULL,
|
|
738
|
+
"Expected assignment for consumer 1 before the change");
|
|
739
|
+
TEST_ASSERT(prev_assignment2 != NULL,
|
|
740
|
+
"Expected assignment for consumer 2 before the change");
|
|
741
|
+
|
|
742
|
+
TEST_SAY("Unsubscribing consumer 1\n");
|
|
743
|
+
rd_kafka_mock_start_request_tracking(mcluster);
|
|
744
|
+
TEST_CALL_ERR__(rd_kafka_unsubscribe(consumer1));
|
|
745
|
+
test_mock_wait_matching_requests(mcluster, 1, 1000, is_api_key,
|
|
746
|
+
&api_key);
|
|
747
|
+
rd_kafka_mock_stop_request_tracking(mcluster);
|
|
748
|
+
|
|
749
|
+
if (variation ==
|
|
750
|
+
DO_TEST_STATIC_MEMBERSHIP_MOCK_VARIATION_NEW_INSTANCE) {
|
|
751
|
+
/* Don't destroy it immediately because the
|
|
752
|
+
* topic partition lists still hold a reference. */
|
|
753
|
+
consumer_1_to_destroy = consumer1;
|
|
754
|
+
|
|
755
|
+
TEST_SAY("Re-creating consumer 1\n");
|
|
756
|
+
/* Re-create the consumer with same group and instance id. */
|
|
757
|
+
consumer1 = create_consumer(bootstraps, topic, "c1");
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
TEST_SAY("Subscribing consumer 1 again\n");
|
|
761
|
+
test_consumer_subscribe(consumer1, topic);
|
|
762
|
+
test_consumer_wait_assignment(consumer1, rd_false);
|
|
763
|
+
|
|
764
|
+
next_generation_id1 = consumer_generation_id(consumer1);
|
|
765
|
+
next_generation_id2 = consumer_generation_id(consumer2);
|
|
766
|
+
|
|
767
|
+
TEST_ASSERT(next_generation_id1 == prev_generation_id1,
|
|
768
|
+
"Expected same generation id for consumer 1, "
|
|
769
|
+
"got %d != %d",
|
|
770
|
+
prev_generation_id1, next_generation_id1);
|
|
771
|
+
TEST_ASSERT(next_generation_id2 == prev_generation_id2,
|
|
772
|
+
"Expected same generation id for consumer 2, "
|
|
773
|
+
"got %d != %d",
|
|
774
|
+
prev_generation_id2, next_generation_id2);
|
|
775
|
+
|
|
776
|
+
TEST_CALL_ERR__(rd_kafka_assignment(consumer1, &next_assignment1));
|
|
777
|
+
TEST_CALL_ERR__(rd_kafka_assignment(consumer2, &next_assignment2));
|
|
778
|
+
TEST_ASSERT(next_assignment1 != NULL,
|
|
779
|
+
"Expected assignment for consumer 1 after the change");
|
|
780
|
+
TEST_ASSERT(next_assignment2 != NULL,
|
|
781
|
+
"Expected assignment for consumer 2 after the change");
|
|
782
|
+
TEST_ASSERT(!test_partition_list_and_offsets_cmp(prev_assignment1,
|
|
783
|
+
next_assignment1),
|
|
784
|
+
"Expected same assignment for consumer 1 after the change");
|
|
785
|
+
TEST_ASSERT(!test_partition_list_and_offsets_cmp(prev_assignment2,
|
|
786
|
+
next_assignment2),
|
|
787
|
+
"Expected same assignment for consumer 2 after the change");
|
|
788
|
+
|
|
789
|
+
rd_kafka_topic_partition_list_destroy(prev_assignment1);
|
|
790
|
+
rd_kafka_topic_partition_list_destroy(prev_assignment2);
|
|
791
|
+
rd_kafka_topic_partition_list_destroy(next_assignment1);
|
|
792
|
+
rd_kafka_topic_partition_list_destroy(next_assignment2);
|
|
793
|
+
|
|
794
|
+
RD_IF_FREE(consumer_1_to_destroy, rd_kafka_destroy);
|
|
795
|
+
rd_kafka_destroy(consumer1);
|
|
796
|
+
rd_kafka_destroy(consumer2);
|
|
797
|
+
test_mock_cluster_destroy(mcluster);
|
|
798
|
+
|
|
799
|
+
SUB_TEST_PASS();
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
int main_0102_static_group_rebalance(int argc, char **argv) {
|
|
803
|
+
/* TODO: check again when regexes
|
|
804
|
+
* will be supported by KIP-848 */
|
|
805
|
+
if (test_consumer_group_protocol_classic()) {
|
|
806
|
+
do_test_static_group_rebalance();
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
if (test_consumer_group_protocol_classic()) {
|
|
810
|
+
do_test_fenced_member_classic();
|
|
811
|
+
} else {
|
|
812
|
+
do_test_fenced_member_consumer();
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
return 0;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
int main_0102_static_group_rebalance_mock(int argc, char **argv) {
|
|
819
|
+
TEST_SKIP_MOCK_CLUSTER(0);
|
|
820
|
+
int variation;
|
|
821
|
+
|
|
822
|
+
if (test_consumer_group_protocol_classic()) {
|
|
823
|
+
TEST_SKIP(
|
|
824
|
+
"Static membership isn't implemented "
|
|
825
|
+
"in mock cluster for classic protocol\n");
|
|
826
|
+
return 0;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
for (variation = DO_TEST_STATIC_MEMBERSHIP_MOCK_VARIATION_SAME_INSTANCE;
|
|
830
|
+
variation < DO_TEST_STATIC_MEMBERSHIP_MOCK_VARIATION__CNT;
|
|
831
|
+
variation++) {
|
|
832
|
+
do_test_static_membership_mock(variation);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
return 0;
|
|
836
|
+
}
|