@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,1010 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* librdkafka - Apache Kafka C library
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2012-2022, Magnus Edenhill
|
|
5
|
+
* 2023, 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
|
+
#include "rdkafka.h"
|
|
32
|
+
|
|
33
|
+
#include <stdarg.h>
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Verify that subscription is updated on metadata changes:
|
|
37
|
+
* - topic additions
|
|
38
|
+
* - topic deletions
|
|
39
|
+
* - partition count changes
|
|
40
|
+
* - replica rack changes (using mock broker)
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Wait for REBALANCE ASSIGN event and perform assignment
|
|
47
|
+
*
|
|
48
|
+
* Va-args are \p topic_cnt tuples of the expected assignment:
|
|
49
|
+
* { const char *topic, int partition_cnt }
|
|
50
|
+
*/
|
|
51
|
+
static void await_assignment(const char *pfx,
|
|
52
|
+
rd_kafka_t *rk,
|
|
53
|
+
rd_kafka_queue_t *queue,
|
|
54
|
+
int topic_cnt,
|
|
55
|
+
...) {
|
|
56
|
+
rd_kafka_event_t *rkev;
|
|
57
|
+
rd_kafka_topic_partition_list_t *tps;
|
|
58
|
+
int i;
|
|
59
|
+
va_list ap;
|
|
60
|
+
int fails = 0;
|
|
61
|
+
int exp_part_cnt = 0;
|
|
62
|
+
|
|
63
|
+
TEST_SAY("%s: waiting for assignment\n", pfx);
|
|
64
|
+
rkev = test_wait_event(queue, RD_KAFKA_EVENT_REBALANCE, 30000);
|
|
65
|
+
if (!rkev)
|
|
66
|
+
TEST_FAIL("timed out waiting for assignment");
|
|
67
|
+
TEST_ASSERT(rd_kafka_event_error(rkev) ==
|
|
68
|
+
RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS,
|
|
69
|
+
"expected ASSIGN, got %s",
|
|
70
|
+
rd_kafka_err2str(rd_kafka_event_error(rkev)));
|
|
71
|
+
tps = rd_kafka_event_topic_partition_list(rkev);
|
|
72
|
+
|
|
73
|
+
TEST_SAY("%s: assignment:\n", pfx);
|
|
74
|
+
test_print_partition_list(tps);
|
|
75
|
+
|
|
76
|
+
va_start(ap, topic_cnt);
|
|
77
|
+
for (i = 0; i < topic_cnt; i++) {
|
|
78
|
+
const char *topic = va_arg(ap, const char *);
|
|
79
|
+
int partition_cnt = va_arg(ap, int);
|
|
80
|
+
int p;
|
|
81
|
+
TEST_SAY("%s: expecting %s with %d partitions\n", pfx, topic,
|
|
82
|
+
partition_cnt);
|
|
83
|
+
for (p = 0; p < partition_cnt; p++) {
|
|
84
|
+
if (!rd_kafka_topic_partition_list_find(tps, topic,
|
|
85
|
+
p)) {
|
|
86
|
+
TEST_FAIL_LATER(
|
|
87
|
+
"%s: expected partition %s [%d] "
|
|
88
|
+
"not found in assginment",
|
|
89
|
+
pfx, topic, p);
|
|
90
|
+
fails++;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exp_part_cnt += partition_cnt;
|
|
94
|
+
}
|
|
95
|
+
va_end(ap);
|
|
96
|
+
|
|
97
|
+
TEST_ASSERT(exp_part_cnt == tps->cnt,
|
|
98
|
+
"expected assignment of %d partitions, got %d",
|
|
99
|
+
exp_part_cnt, tps->cnt);
|
|
100
|
+
|
|
101
|
+
if (fails > 0)
|
|
102
|
+
TEST_FAIL("%s: assignment mismatch: see above", pfx);
|
|
103
|
+
|
|
104
|
+
test_consumer_assign_by_rebalance_protocol("rebalance event", rk, tps);
|
|
105
|
+
rd_kafka_event_destroy(rkev);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Wait for REBALANCE REVOKE event and perform unassignment.
|
|
111
|
+
*/
|
|
112
|
+
static void
|
|
113
|
+
await_revoke(const char *pfx, rd_kafka_t *rk, rd_kafka_queue_t *queue) {
|
|
114
|
+
rd_kafka_event_t *rkev;
|
|
115
|
+
rd_kafka_topic_partition_list_t *tps;
|
|
116
|
+
|
|
117
|
+
TEST_SAY("%s: waiting for revoke\n", pfx);
|
|
118
|
+
rkev = test_wait_event(queue, RD_KAFKA_EVENT_REBALANCE, 30000);
|
|
119
|
+
if (!rkev)
|
|
120
|
+
TEST_FAIL("timed out waiting for revoke");
|
|
121
|
+
TEST_ASSERT(rd_kafka_event_error(rkev) ==
|
|
122
|
+
RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS,
|
|
123
|
+
"expected REVOKE, got %s",
|
|
124
|
+
rd_kafka_err2str(rd_kafka_event_error(rkev)));
|
|
125
|
+
tps = rd_kafka_event_topic_partition_list(rkev);
|
|
126
|
+
|
|
127
|
+
test_consumer_unassign_by_rebalance_protocol("rebalance event", rk,
|
|
128
|
+
tps);
|
|
129
|
+
rd_kafka_event_destroy(rkev);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Wait \p timeout_ms to make sure no rebalance was triggered.
|
|
134
|
+
*/
|
|
135
|
+
static void await_no_rebalance(const char *pfx,
|
|
136
|
+
rd_kafka_t *rk,
|
|
137
|
+
rd_kafka_queue_t *queue,
|
|
138
|
+
int timeout_ms) {
|
|
139
|
+
rd_kafka_event_t *rkev;
|
|
140
|
+
|
|
141
|
+
TEST_SAY("%s: waiting for %d ms to not see rebalance\n", pfx,
|
|
142
|
+
timeout_ms);
|
|
143
|
+
rkev = test_wait_event(queue, RD_KAFKA_EVENT_REBALANCE, timeout_ms);
|
|
144
|
+
if (!rkev)
|
|
145
|
+
return;
|
|
146
|
+
TEST_ASSERT(rkev, "did not expect %s: %s", rd_kafka_event_name(rkev),
|
|
147
|
+
rd_kafka_err2str(rd_kafka_event_error(rkev)));
|
|
148
|
+
rd_kafka_event_destroy(rkev);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Wait for REBALANCE event and perform assignment/unassignment.
|
|
154
|
+
* For the first time and after each event, wait till for \p timeout before
|
|
155
|
+
* stopping. Terminates earlier if \p min_events were seen.
|
|
156
|
+
* Asserts that \p min_events were processed.
|
|
157
|
+
* \p min_events set to 0 means it tries to drain all rebalance events and
|
|
158
|
+
* asserts only the fact that at least 1 event was processed.
|
|
159
|
+
*/
|
|
160
|
+
static void await_rebalance(const char *pfx,
|
|
161
|
+
rd_kafka_t *rk,
|
|
162
|
+
rd_kafka_queue_t *queue,
|
|
163
|
+
int timeout_ms,
|
|
164
|
+
int min_events) {
|
|
165
|
+
rd_kafka_event_t *rkev;
|
|
166
|
+
int processed = 0;
|
|
167
|
+
|
|
168
|
+
while (1) {
|
|
169
|
+
TEST_SAY("%s: waiting for %d ms for rebalance event\n", pfx,
|
|
170
|
+
timeout_ms);
|
|
171
|
+
|
|
172
|
+
rkev = test_wait_event(queue, RD_KAFKA_EVENT_REBALANCE,
|
|
173
|
+
timeout_ms);
|
|
174
|
+
if (!rkev)
|
|
175
|
+
break;
|
|
176
|
+
TEST_ASSERT(rd_kafka_event_type(rkev) ==
|
|
177
|
+
RD_KAFKA_EVENT_REBALANCE,
|
|
178
|
+
"either expected a timeout or a "
|
|
179
|
+
"RD_KAFKA_EVENT_REBALANCE, got %s : %s",
|
|
180
|
+
rd_kafka_event_name(rkev),
|
|
181
|
+
rd_kafka_err2str(rd_kafka_event_error(rkev)));
|
|
182
|
+
|
|
183
|
+
TEST_SAY("Calling test_rebalance_cb, assignment type is %s\n",
|
|
184
|
+
rd_kafka_rebalance_protocol(rk));
|
|
185
|
+
test_rebalance_cb(rk, rd_kafka_event_error(rkev),
|
|
186
|
+
rd_kafka_event_topic_partition_list(rkev),
|
|
187
|
+
NULL);
|
|
188
|
+
|
|
189
|
+
processed++;
|
|
190
|
+
|
|
191
|
+
rd_kafka_event_destroy(rkev);
|
|
192
|
+
|
|
193
|
+
if (min_events && processed >= min_events)
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (min_events)
|
|
198
|
+
min_events = 1;
|
|
199
|
+
|
|
200
|
+
TEST_ASSERT(
|
|
201
|
+
processed >= min_events,
|
|
202
|
+
"Expected to process at least %d rebalance event, processed %d",
|
|
203
|
+
min_events, processed);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
static void do_test_non_exist_and_partchange(void) {
|
|
207
|
+
char *topic_a = rd_strdup(test_mk_topic_name("topic_a", 1));
|
|
208
|
+
rd_kafka_t *rk;
|
|
209
|
+
rd_kafka_conf_t *conf;
|
|
210
|
+
rd_kafka_queue_t *queue;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Test #1:
|
|
214
|
+
* - Subscribe to non-existing topic.
|
|
215
|
+
* - Verify empty assignment
|
|
216
|
+
* - Create topic
|
|
217
|
+
* - Verify new assignment containing topic
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
SUB_TEST();
|
|
221
|
+
|
|
222
|
+
test_conf_init(&conf, NULL, 60);
|
|
223
|
+
|
|
224
|
+
/* Decrease metadata interval to speed up topic change discovery. */
|
|
225
|
+
test_conf_set(conf, "topic.metadata.refresh.interval.ms", "5000");
|
|
226
|
+
|
|
227
|
+
rd_kafka_conf_set_events(conf, RD_KAFKA_EVENT_REBALANCE);
|
|
228
|
+
rk = test_create_consumer(test_str_id_generate_tmp(), NULL, conf, NULL);
|
|
229
|
+
queue = rd_kafka_queue_get_consumer(rk);
|
|
230
|
+
|
|
231
|
+
TEST_SAY("#1: Subscribing to %s\n", topic_a);
|
|
232
|
+
test_consumer_subscribe(rk, topic_a);
|
|
233
|
+
|
|
234
|
+
/* Should not see a rebalance since no topics are matched. */
|
|
235
|
+
await_no_rebalance("#1: empty", rk, queue, 10000);
|
|
236
|
+
|
|
237
|
+
TEST_SAY("#1: creating topic %s\n", topic_a);
|
|
238
|
+
test_create_topic_wait_exists(NULL, topic_a, 2, 1, 5000);
|
|
239
|
+
|
|
240
|
+
await_assignment("#1: proper", rk, queue, 1, topic_a, 2);
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Test #2 (continue with #1 consumer)
|
|
245
|
+
* - Increase the partition count
|
|
246
|
+
* - Verify updated assignment
|
|
247
|
+
*/
|
|
248
|
+
test_kafka_topics("--alter --topic %s --partitions 4", topic_a);
|
|
249
|
+
await_revoke("#2", rk, queue);
|
|
250
|
+
|
|
251
|
+
await_assignment("#2: more partitions", rk, queue, 1, topic_a, 4);
|
|
252
|
+
|
|
253
|
+
test_consumer_close(rk);
|
|
254
|
+
rd_kafka_queue_destroy(queue);
|
|
255
|
+
rd_kafka_destroy(rk);
|
|
256
|
+
|
|
257
|
+
rd_free(topic_a);
|
|
258
|
+
|
|
259
|
+
SUB_TEST_PASS();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
static void do_test_regex(void) {
|
|
265
|
+
char *base_topic = rd_strdup(test_mk_topic_name("topic", 1));
|
|
266
|
+
char *topic_b = rd_strdup(tsprintf("%s_b", base_topic));
|
|
267
|
+
char *topic_c = rd_strdup(tsprintf("%s_c", base_topic));
|
|
268
|
+
char *topic_d = rd_strdup(tsprintf("%s_d", base_topic));
|
|
269
|
+
char *topic_e = rd_strdup(tsprintf("%s_e", base_topic));
|
|
270
|
+
rd_kafka_t *rk;
|
|
271
|
+
rd_kafka_conf_t *conf;
|
|
272
|
+
rd_kafka_queue_t *queue;
|
|
273
|
+
const char *rebalance_protocol;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Regex test:
|
|
277
|
+
* - Create topic b
|
|
278
|
+
* - Subscribe to b & d & e
|
|
279
|
+
* - Verify b assignment
|
|
280
|
+
* - Create topic c
|
|
281
|
+
* - Verify no rebalance
|
|
282
|
+
* - Create topic d
|
|
283
|
+
* - Verify b & d assignment
|
|
284
|
+
*/
|
|
285
|
+
|
|
286
|
+
SUB_TEST();
|
|
287
|
+
|
|
288
|
+
test_conf_init(&conf, NULL, 60);
|
|
289
|
+
|
|
290
|
+
/* Decrease metadata interval to speed up topic change discovery. */
|
|
291
|
+
test_conf_set(conf, "topic.metadata.refresh.interval.ms", "5000");
|
|
292
|
+
|
|
293
|
+
rd_kafka_conf_set_events(conf, RD_KAFKA_EVENT_REBALANCE);
|
|
294
|
+
rk = test_create_consumer(test_str_id_generate_tmp(), NULL, conf, NULL);
|
|
295
|
+
queue = rd_kafka_queue_get_consumer(rk);
|
|
296
|
+
|
|
297
|
+
TEST_SAY("Regex: creating topic %s (subscribed)\n", topic_b);
|
|
298
|
+
test_create_topic_wait_exists(NULL, topic_b, 2, 1, 5000);
|
|
299
|
+
|
|
300
|
+
TEST_SAY("Regex: Subscribing to %s & %s & %s\n", topic_b, topic_d,
|
|
301
|
+
topic_e);
|
|
302
|
+
test_consumer_subscribe(rk, tsprintf("^%s_[bde]$", base_topic));
|
|
303
|
+
|
|
304
|
+
await_assignment("Regex: just one topic exists", rk, queue, 1, topic_b,
|
|
305
|
+
2);
|
|
306
|
+
|
|
307
|
+
TEST_SAY("Regex: creating topic %s (not subscribed)\n", topic_c);
|
|
308
|
+
test_create_topic_wait_exists(NULL, topic_c, 4, 1, 5000);
|
|
309
|
+
|
|
310
|
+
/* Should not see a rebalance since no topics are matched. */
|
|
311
|
+
await_no_rebalance("Regex: empty", rk, queue, 10000);
|
|
312
|
+
|
|
313
|
+
TEST_SAY("Regex: creating topic %s (subscribed)\n", topic_d);
|
|
314
|
+
test_create_topic_wait_exists(NULL, topic_d, 1, 1, 5000);
|
|
315
|
+
|
|
316
|
+
if (test_consumer_group_protocol_classic())
|
|
317
|
+
await_revoke("Regex: rebalance after topic creation", rk,
|
|
318
|
+
queue);
|
|
319
|
+
|
|
320
|
+
rebalance_protocol = rd_kafka_rebalance_protocol(rk);
|
|
321
|
+
if (!strcmp(rebalance_protocol, "COOPERATIVE")) {
|
|
322
|
+
await_assignment("Regex: two topics exist", rk, queue, 1,
|
|
323
|
+
topic_d, 1);
|
|
324
|
+
} else {
|
|
325
|
+
await_assignment("Regex: two topics exist", rk, queue, 2,
|
|
326
|
+
topic_b, 2, topic_d, 1);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
test_consumer_close(rk);
|
|
330
|
+
rd_kafka_queue_destroy(queue);
|
|
331
|
+
rd_kafka_destroy(rk);
|
|
332
|
+
|
|
333
|
+
rd_free(base_topic);
|
|
334
|
+
rd_free(topic_b);
|
|
335
|
+
rd_free(topic_c);
|
|
336
|
+
rd_free(topic_d);
|
|
337
|
+
rd_free(topic_e);
|
|
338
|
+
|
|
339
|
+
SUB_TEST_PASS();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* @remark Requires scenario=noautocreate.
|
|
344
|
+
*/
|
|
345
|
+
static void do_test_topic_remove(void) {
|
|
346
|
+
char *topic_f = rd_strdup(test_mk_topic_name("topic_f", 1));
|
|
347
|
+
char *topic_g = rd_strdup(test_mk_topic_name("topic_g", 1));
|
|
348
|
+
int parts_f = 5;
|
|
349
|
+
int parts_g = 9;
|
|
350
|
+
rd_kafka_t *rk;
|
|
351
|
+
rd_kafka_conf_t *conf;
|
|
352
|
+
rd_kafka_queue_t *queue;
|
|
353
|
+
rd_kafka_topic_partition_list_t *topics;
|
|
354
|
+
rd_kafka_resp_err_t err;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Topic removal test:
|
|
358
|
+
* - Create topic f & g
|
|
359
|
+
* - Subscribe to f & g
|
|
360
|
+
* - Verify f & g assignment
|
|
361
|
+
* - Remove topic f
|
|
362
|
+
* - Verify g assignment
|
|
363
|
+
* - Remove topic g
|
|
364
|
+
* - Verify empty assignment
|
|
365
|
+
*/
|
|
366
|
+
|
|
367
|
+
SUB_TEST("Topic removal testing");
|
|
368
|
+
|
|
369
|
+
test_conf_init(&conf, NULL, 60);
|
|
370
|
+
|
|
371
|
+
/* Decrease metadata interval to speed up topic change discovery. */
|
|
372
|
+
test_conf_set(conf, "topic.metadata.refresh.interval.ms", "5000");
|
|
373
|
+
|
|
374
|
+
rd_kafka_conf_set_events(conf, RD_KAFKA_EVENT_REBALANCE);
|
|
375
|
+
rk = test_create_consumer(test_str_id_generate_tmp(), NULL, conf, NULL);
|
|
376
|
+
queue = rd_kafka_queue_get_consumer(rk);
|
|
377
|
+
|
|
378
|
+
TEST_SAY("Topic removal: creating topic %s (subscribed)\n", topic_f);
|
|
379
|
+
test_create_topic_wait_exists(NULL, topic_f, parts_f, 1, 5000);
|
|
380
|
+
|
|
381
|
+
TEST_SAY("Topic removal: creating topic %s (subscribed)\n", topic_g);
|
|
382
|
+
test_create_topic_wait_exists(NULL, topic_g, parts_g, 1, 5000);
|
|
383
|
+
|
|
384
|
+
TEST_SAY("Topic removal: Subscribing to %s & %s\n", topic_f, topic_g);
|
|
385
|
+
topics = rd_kafka_topic_partition_list_new(2);
|
|
386
|
+
rd_kafka_topic_partition_list_add(topics, topic_f,
|
|
387
|
+
RD_KAFKA_PARTITION_UA);
|
|
388
|
+
rd_kafka_topic_partition_list_add(topics, topic_g,
|
|
389
|
+
RD_KAFKA_PARTITION_UA);
|
|
390
|
+
err = rd_kafka_subscribe(rk, topics);
|
|
391
|
+
TEST_ASSERT(err == RD_KAFKA_RESP_ERR_NO_ERROR, "%s",
|
|
392
|
+
rd_kafka_err2str(err));
|
|
393
|
+
rd_kafka_topic_partition_list_destroy(topics);
|
|
394
|
+
|
|
395
|
+
await_assignment("Topic removal: both topics exist", rk, queue, 2,
|
|
396
|
+
topic_f, parts_f, topic_g, parts_g);
|
|
397
|
+
|
|
398
|
+
TEST_SAY("Topic removal: removing %s\n", topic_f);
|
|
399
|
+
test_kafka_topics("--delete --topic %s", topic_f);
|
|
400
|
+
|
|
401
|
+
await_revoke("Topic removal: rebalance after topic removal", rk, queue);
|
|
402
|
+
|
|
403
|
+
await_assignment("Topic removal: one topic exists", rk, queue, 1,
|
|
404
|
+
topic_g, parts_g);
|
|
405
|
+
|
|
406
|
+
TEST_SAY("Topic removal: removing %s\n", topic_g);
|
|
407
|
+
test_kafka_topics("--delete --topic %s", topic_g);
|
|
408
|
+
|
|
409
|
+
await_revoke("Topic removal: rebalance after 2nd topic removal", rk,
|
|
410
|
+
queue);
|
|
411
|
+
|
|
412
|
+
/* Should not see another rebalance since all topics now removed */
|
|
413
|
+
await_no_rebalance("Topic removal: empty", rk, queue, 10000);
|
|
414
|
+
|
|
415
|
+
test_consumer_close(rk);
|
|
416
|
+
rd_kafka_queue_destroy(queue);
|
|
417
|
+
rd_kafka_destroy(rk);
|
|
418
|
+
|
|
419
|
+
rd_free(topic_f);
|
|
420
|
+
rd_free(topic_g);
|
|
421
|
+
|
|
422
|
+
SUB_TEST_PASS();
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* @brief Subscribe to a regex and continually create a lot of matching topics,
|
|
429
|
+
* triggering many rebalances.
|
|
430
|
+
*
|
|
431
|
+
* This is using the mock cluster.
|
|
432
|
+
*
|
|
433
|
+
*/
|
|
434
|
+
static void do_test_regex_many_mock(const char *assignment_strategy,
|
|
435
|
+
rd_bool_t lots_of_topics) {
|
|
436
|
+
const char *base_topic = "topic";
|
|
437
|
+
rd_kafka_t *rk;
|
|
438
|
+
rd_kafka_conf_t *conf;
|
|
439
|
+
rd_kafka_mock_cluster_t *mcluster;
|
|
440
|
+
const char *bootstraps;
|
|
441
|
+
int topic_cnt = lots_of_topics ? 300 : 50;
|
|
442
|
+
int await_assignment_every = lots_of_topics ? 150 : 15;
|
|
443
|
+
int i;
|
|
444
|
+
|
|
445
|
+
SUB_TEST("%s with %d topics", assignment_strategy, topic_cnt);
|
|
446
|
+
|
|
447
|
+
mcluster = test_mock_cluster_new(3, &bootstraps);
|
|
448
|
+
test_conf_init(&conf, NULL, 60 * 5);
|
|
449
|
+
|
|
450
|
+
test_conf_set(conf, "security.protocol", "plaintext");
|
|
451
|
+
test_conf_set(conf, "bootstrap.servers", bootstraps);
|
|
452
|
+
test_conf_set(conf, "partition.assignment.strategy",
|
|
453
|
+
assignment_strategy);
|
|
454
|
+
/* Decrease metadata interval to speed up topic change discovery. */
|
|
455
|
+
test_conf_set(conf, "topic.metadata.refresh.interval.ms", "3000");
|
|
456
|
+
|
|
457
|
+
rk = test_create_consumer("mygroup", test_rebalance_cb, conf, NULL);
|
|
458
|
+
|
|
459
|
+
test_consumer_subscribe(rk, tsprintf("^%s_.*", base_topic));
|
|
460
|
+
|
|
461
|
+
for (i = 0; i < topic_cnt; i++) {
|
|
462
|
+
char topic[256];
|
|
463
|
+
|
|
464
|
+
rd_snprintf(topic, sizeof(topic), "%s_%d", base_topic, i);
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
TEST_SAY("Creating topic %s\n", topic);
|
|
468
|
+
TEST_CALL_ERR__(rd_kafka_mock_topic_create(mcluster, topic,
|
|
469
|
+
1 + (i % 8), 1));
|
|
470
|
+
|
|
471
|
+
test_consumer_poll_no_msgs("POLL", rk, 0,
|
|
472
|
+
lots_of_topics ? 100 : 300);
|
|
473
|
+
|
|
474
|
+
/* Wait for an assignment to let the consumer catch up on
|
|
475
|
+
* all rebalancing. */
|
|
476
|
+
if (i % await_assignment_every == await_assignment_every - 1)
|
|
477
|
+
test_consumer_wait_assignment(rk, rd_true /*poll*/);
|
|
478
|
+
else if (!lots_of_topics)
|
|
479
|
+
rd_usleep(100 * 1000, NULL);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
test_consumer_close(rk);
|
|
483
|
+
rd_kafka_destroy(rk);
|
|
484
|
+
|
|
485
|
+
test_mock_cluster_destroy(mcluster);
|
|
486
|
+
|
|
487
|
+
SUB_TEST_PASS();
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* @brief Changing the broker racks should trigger a rejoin, if the client rack
|
|
493
|
+
* is set, and the set of partition racks changes due to the broker rack change.
|
|
494
|
+
*
|
|
495
|
+
* This is using the mock cluster.
|
|
496
|
+
*
|
|
497
|
+
*/
|
|
498
|
+
static void do_test_replica_rack_change_mock(const char *assignment_strategy,
|
|
499
|
+
rd_bool_t use_regex,
|
|
500
|
+
rd_bool_t use_client_rack,
|
|
501
|
+
rd_bool_t use_replica_rack) {
|
|
502
|
+
const char *subscription = use_regex ? "^top" : "topic";
|
|
503
|
+
const char *topic = "topic";
|
|
504
|
+
const char *test_name = tsprintf(
|
|
505
|
+
"Replica rack changes (%s, subscription = \"%s\", %s client.rack, "
|
|
506
|
+
"%s replica.rack)",
|
|
507
|
+
assignment_strategy, subscription,
|
|
508
|
+
use_client_rack ? "with" : "without",
|
|
509
|
+
use_replica_rack ? "with" : "without");
|
|
510
|
+
rd_kafka_t *rk;
|
|
511
|
+
rd_kafka_conf_t *conf;
|
|
512
|
+
rd_kafka_mock_cluster_t *mcluster;
|
|
513
|
+
const char *bootstraps;
|
|
514
|
+
rd_kafka_queue_t *queue;
|
|
515
|
+
|
|
516
|
+
SUB_TEST("Testing %s", test_name);
|
|
517
|
+
|
|
518
|
+
mcluster = test_mock_cluster_new(3, &bootstraps);
|
|
519
|
+
test_conf_init(&conf, NULL, 60 * 4);
|
|
520
|
+
|
|
521
|
+
if (use_replica_rack) {
|
|
522
|
+
rd_kafka_mock_broker_set_rack(mcluster, 1, "rack0");
|
|
523
|
+
rd_kafka_mock_broker_set_rack(mcluster, 2, "rack1");
|
|
524
|
+
rd_kafka_mock_broker_set_rack(mcluster, 3, "rack2");
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
TEST_SAY("Creating topic %s\n", topic);
|
|
528
|
+
TEST_CALL_ERR__(rd_kafka_mock_topic_create(mcluster, topic,
|
|
529
|
+
2 /* partition_cnt */,
|
|
530
|
+
1 /* replication_factor */));
|
|
531
|
+
|
|
532
|
+
test_conf_set(conf, "bootstrap.servers", bootstraps);
|
|
533
|
+
test_conf_set(conf, "partition.assignment.strategy",
|
|
534
|
+
assignment_strategy);
|
|
535
|
+
/* Decrease metadata interval to speed up topic change discovery. */
|
|
536
|
+
test_conf_set(conf, "topic.metadata.refresh.interval.ms", "3000");
|
|
537
|
+
|
|
538
|
+
if (use_client_rack)
|
|
539
|
+
test_conf_set(conf, "client.rack", "client_rack");
|
|
540
|
+
|
|
541
|
+
rd_kafka_conf_set_events(conf, RD_KAFKA_EVENT_REBALANCE);
|
|
542
|
+
rk = test_create_consumer(test_str_id_generate_tmp(), NULL, conf, NULL);
|
|
543
|
+
queue = rd_kafka_queue_get_consumer(rk);
|
|
544
|
+
|
|
545
|
+
TEST_SAY("%s: Subscribing via %s\n", test_name, subscription);
|
|
546
|
+
test_consumer_subscribe(rk, subscription);
|
|
547
|
+
|
|
548
|
+
await_rebalance(tsprintf("%s: initial assignment", test_name), rk,
|
|
549
|
+
queue, 10000, 1);
|
|
550
|
+
|
|
551
|
+
/* Avoid issues if the replica assignment algorithm for mock broker
|
|
552
|
+
* changes, and change all the racks. */
|
|
553
|
+
if (use_replica_rack) {
|
|
554
|
+
TEST_SAY("%s: changing rack for all brokers\n", test_name);
|
|
555
|
+
rd_kafka_mock_broker_set_rack(mcluster, 1, "rack2");
|
|
556
|
+
rd_kafka_mock_broker_set_rack(mcluster, 2, "rack0");
|
|
557
|
+
rd_kafka_mock_broker_set_rack(mcluster, 3, "rack1");
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
if (use_client_rack && use_replica_rack)
|
|
561
|
+
await_rebalance(tsprintf("%s: rebalance", test_name), rk, queue,
|
|
562
|
+
10000, 1);
|
|
563
|
+
else
|
|
564
|
+
await_no_rebalance(
|
|
565
|
+
tsprintf("%s: no rebalance without racks", test_name), rk,
|
|
566
|
+
queue, 10000);
|
|
567
|
+
|
|
568
|
+
test_consumer_close(rk);
|
|
569
|
+
rd_kafka_queue_destroy(queue);
|
|
570
|
+
rd_kafka_destroy(rk);
|
|
571
|
+
test_mock_cluster_destroy(mcluster);
|
|
572
|
+
|
|
573
|
+
SUB_TEST_PASS();
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
/* Even if the leader has no rack, it should do rack-aware assignment in case
|
|
578
|
+
* one of the group members has a rack configured. */
|
|
579
|
+
static void do_test_replica_rack_change_leader_no_rack_mock(
|
|
580
|
+
const char *assignment_strategy) {
|
|
581
|
+
const char *topic = "topic";
|
|
582
|
+
const char *test_name = "Replica rack changes with leader rack absent.";
|
|
583
|
+
rd_kafka_t *c1, *c2;
|
|
584
|
+
rd_kafka_conf_t *conf1, *conf2;
|
|
585
|
+
rd_kafka_mock_cluster_t *mcluster;
|
|
586
|
+
const char *bootstraps;
|
|
587
|
+
rd_kafka_queue_t *queue;
|
|
588
|
+
rd_kafka_topic_partition_list_t *asg1, *asg2;
|
|
589
|
+
|
|
590
|
+
SUB_TEST("Testing %s", test_name);
|
|
591
|
+
|
|
592
|
+
mcluster = test_mock_cluster_new(2, &bootstraps);
|
|
593
|
+
test_conf_init(&conf1, NULL, 60 * 4);
|
|
594
|
+
|
|
595
|
+
rd_kafka_mock_broker_set_rack(mcluster, 1, "rack0");
|
|
596
|
+
rd_kafka_mock_broker_set_rack(mcluster, 2, "rack1");
|
|
597
|
+
|
|
598
|
+
TEST_SAY("Creating topic %s\n", topic);
|
|
599
|
+
TEST_CALL_ERR__(rd_kafka_mock_topic_create(mcluster, topic,
|
|
600
|
+
2 /* partition_cnt */,
|
|
601
|
+
1 /* replication_factor */));
|
|
602
|
+
|
|
603
|
+
test_conf_set(conf1, "bootstrap.servers", bootstraps);
|
|
604
|
+
test_conf_set(conf1, "partition.assignment.strategy",
|
|
605
|
+
assignment_strategy);
|
|
606
|
+
/* Decrease metadata interval to speed up topic change discovery. */
|
|
607
|
+
test_conf_set(conf1, "topic.metadata.refresh.interval.ms", "3000");
|
|
608
|
+
|
|
609
|
+
conf2 = rd_kafka_conf_dup(conf1);
|
|
610
|
+
|
|
611
|
+
/* Setting the group.instance.id ensures that the leader is always c1.
|
|
612
|
+
*/
|
|
613
|
+
test_conf_set(conf1, "client.id", "client1Leader");
|
|
614
|
+
test_conf_set(conf1, "group.instance.id", "client1Leader");
|
|
615
|
+
|
|
616
|
+
test_conf_set(conf2, "client.id", "client2Follower");
|
|
617
|
+
test_conf_set(conf2, "group.instance.id", "client2Follower");
|
|
618
|
+
test_conf_set(conf2, "client.rack", "rack0");
|
|
619
|
+
|
|
620
|
+
rd_kafka_conf_set_events(conf1, RD_KAFKA_EVENT_REBALANCE);
|
|
621
|
+
c1 = test_create_consumer("mygroup", NULL, conf1, NULL);
|
|
622
|
+
queue = rd_kafka_queue_get_consumer(c1);
|
|
623
|
+
|
|
624
|
+
c2 = test_create_consumer("mygroup", NULL, conf2, NULL);
|
|
625
|
+
|
|
626
|
+
TEST_SAY("%s: Subscribing via %s\n", test_name, topic);
|
|
627
|
+
test_consumer_subscribe(c1, topic);
|
|
628
|
+
test_consumer_subscribe(c2, topic);
|
|
629
|
+
|
|
630
|
+
/* Poll to cause joining. */
|
|
631
|
+
rd_kafka_poll(c1, 1);
|
|
632
|
+
rd_kafka_poll(c2, 1);
|
|
633
|
+
|
|
634
|
+
/* Drain all events, as we want to process the assignment. */
|
|
635
|
+
await_rebalance(tsprintf("%s: initial assignment", test_name), c1,
|
|
636
|
+
queue, 10000, 0);
|
|
637
|
+
|
|
638
|
+
rd_kafka_assignment(c1, &asg1);
|
|
639
|
+
rd_kafka_assignment(c2, &asg2);
|
|
640
|
+
|
|
641
|
+
/* Because of the deterministic nature of replica assignment in the mock
|
|
642
|
+
* broker, we can always be certain that topic:0 has its only replica on
|
|
643
|
+
* broker 1, and topic:1 has its only replica on broker 2. */
|
|
644
|
+
TEST_ASSERT(asg1->cnt == 1 && asg1->elems[0].partition == 1,
|
|
645
|
+
"Expected c1 to be assigned topic1:1");
|
|
646
|
+
TEST_ASSERT(asg2->cnt == 1 && asg2->elems[0].partition == 0,
|
|
647
|
+
"Expected c2 to be assigned topic1:0");
|
|
648
|
+
|
|
649
|
+
rd_kafka_topic_partition_list_destroy(asg1);
|
|
650
|
+
rd_kafka_topic_partition_list_destroy(asg2);
|
|
651
|
+
|
|
652
|
+
/* Avoid issues if the replica assignment algorithm for mock broker
|
|
653
|
+
* changes, and change all the racks. */
|
|
654
|
+
TEST_SAY("%s: changing rack for all brokers\n", test_name);
|
|
655
|
+
rd_kafka_mock_broker_set_rack(mcluster, 2, "rack0");
|
|
656
|
+
rd_kafka_mock_broker_set_rack(mcluster, 1, "rack1");
|
|
657
|
+
|
|
658
|
+
/* Poll to cause rejoining. */
|
|
659
|
+
rd_kafka_poll(c1, 1);
|
|
660
|
+
rd_kafka_poll(c2, 1);
|
|
661
|
+
|
|
662
|
+
/* Drain all events, as we want to process the assignment. */
|
|
663
|
+
await_rebalance(tsprintf("%s: rebalance", test_name), c1, queue, 10000,
|
|
664
|
+
0);
|
|
665
|
+
|
|
666
|
+
rd_kafka_assignment(c1, &asg1);
|
|
667
|
+
rd_kafka_assignment(c2, &asg2);
|
|
668
|
+
|
|
669
|
+
/* Because of the deterministic nature of replica assignment in the mock
|
|
670
|
+
* broker, we can always be certain that topic:0 has its only replica on
|
|
671
|
+
* broker 1, and topic:1 has its only replica on broker 2. */
|
|
672
|
+
TEST_ASSERT(asg1->cnt == 1 && asg1->elems[0].partition == 0,
|
|
673
|
+
"Expected c1 to be assigned topic1:0");
|
|
674
|
+
TEST_ASSERT(asg2->cnt == 1 && asg2->elems[0].partition == 1,
|
|
675
|
+
"Expected c2 to be assigned topic1:1");
|
|
676
|
+
|
|
677
|
+
rd_kafka_topic_partition_list_destroy(asg1);
|
|
678
|
+
rd_kafka_topic_partition_list_destroy(asg2);
|
|
679
|
+
|
|
680
|
+
test_consumer_close(c1);
|
|
681
|
+
test_consumer_close(c2);
|
|
682
|
+
rd_kafka_queue_destroy(queue);
|
|
683
|
+
rd_kafka_destroy(c1);
|
|
684
|
+
rd_kafka_destroy(c2);
|
|
685
|
+
test_mock_cluster_destroy(mcluster);
|
|
686
|
+
|
|
687
|
+
SUB_TEST_PASS();
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Checking assignments and revocation operations for subscribe and
|
|
692
|
+
* unsubcribe with regular topic names and regex.
|
|
693
|
+
*/
|
|
694
|
+
static void do_test_resubscribe_with_regex() {
|
|
695
|
+
char *topic1 = rd_strdup(test_mk_topic_name("topic_regex1", 1));
|
|
696
|
+
char *topic2 = rd_strdup(test_mk_topic_name("topic_regex2", 1));
|
|
697
|
+
char *topic_a = rd_strdup(test_mk_topic_name("topic_a", 1));
|
|
698
|
+
char *group = rd_strdup(
|
|
699
|
+
tsprintf("group_test_sub_regex_%s", test_str_id_generate_tmp()));
|
|
700
|
+
rd_kafka_t *rk;
|
|
701
|
+
rd_kafka_conf_t *conf;
|
|
702
|
+
rd_kafka_queue_t *queue;
|
|
703
|
+
|
|
704
|
+
SUB_TEST("Resubscribe with Regex");
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* Topic resubscribe with regex test:
|
|
708
|
+
* - Create topic topic_regex1 & topic_regex2
|
|
709
|
+
* - Subscribe to topic_regex1
|
|
710
|
+
* - Verify topic_regex1 assignment
|
|
711
|
+
* - Unsubscribe
|
|
712
|
+
* - Verify revocation
|
|
713
|
+
* - Subscribe to topic_regex2
|
|
714
|
+
* - Verify topic_regex2 assignment
|
|
715
|
+
* - Unsubscribe
|
|
716
|
+
* - Verify revocation
|
|
717
|
+
* - Subscribe to regex ^.*topic_regex.*
|
|
718
|
+
* - Verify topic_regex1 & topic_regex2 assignment
|
|
719
|
+
* - Unsubscribe
|
|
720
|
+
* - Verify revocation
|
|
721
|
+
* - Subscribe to regex ^.*topic_regex.* and topic_a
|
|
722
|
+
* - Verify topic_regex1, topic_regex2 and topic_a assignment
|
|
723
|
+
* - Unsubscribe
|
|
724
|
+
* - Verify revocation
|
|
725
|
+
*/
|
|
726
|
+
|
|
727
|
+
TEST_SAY("Creating topic %s\n", topic1);
|
|
728
|
+
test_create_topic_wait_exists(NULL, topic1, 4, 1, 5000);
|
|
729
|
+
|
|
730
|
+
TEST_SAY("Creating topic %s\n", topic2);
|
|
731
|
+
test_create_topic_wait_exists(NULL, topic2, 4, 1, 5000);
|
|
732
|
+
|
|
733
|
+
TEST_SAY("Creating topic %s\n", topic_a);
|
|
734
|
+
test_create_topic_wait_exists(NULL, topic_a, 2, 1, 5000);
|
|
735
|
+
|
|
736
|
+
test_conf_init(&conf, NULL, 60);
|
|
737
|
+
|
|
738
|
+
rd_kafka_conf_set_events(conf, RD_KAFKA_EVENT_REBALANCE);
|
|
739
|
+
rk = test_create_consumer(group, NULL, conf, NULL);
|
|
740
|
+
queue = rd_kafka_queue_get_consumer(rk);
|
|
741
|
+
|
|
742
|
+
/* Subscribe to topic1 */
|
|
743
|
+
TEST_SAY("Subscribing to %s\n", topic1);
|
|
744
|
+
test_consumer_subscribe(rk, topic1);
|
|
745
|
+
/* Wait for assignment */
|
|
746
|
+
await_assignment("Assignment for topic1", rk, queue, 1, topic1, 4);
|
|
747
|
+
|
|
748
|
+
/* Unsubscribe from topic1 */
|
|
749
|
+
TEST_SAY("Unsubscribing from %s\n", topic1);
|
|
750
|
+
rd_kafka_unsubscribe(rk);
|
|
751
|
+
/* Wait for revocation */
|
|
752
|
+
await_revoke("Revocation after unsubscribing", rk, queue);
|
|
753
|
+
|
|
754
|
+
/* Subscribe to topic2 */
|
|
755
|
+
TEST_SAY("Subscribing to %s\n", topic2);
|
|
756
|
+
test_consumer_subscribe(rk, topic2);
|
|
757
|
+
/* Wait for assignment */
|
|
758
|
+
await_assignment("Assignment for topic2", rk, queue, 1, topic2, 4);
|
|
759
|
+
|
|
760
|
+
/* Unsubscribe from topic2 */
|
|
761
|
+
TEST_SAY("Unsubscribing from %s\n", topic2);
|
|
762
|
+
rd_kafka_unsubscribe(rk);
|
|
763
|
+
/* Wait for revocation */
|
|
764
|
+
await_revoke("Revocation after unsubscribing", rk, queue);
|
|
765
|
+
|
|
766
|
+
/* Subscribe to regex ^.*topic_regex.* */
|
|
767
|
+
TEST_SAY("Subscribing to regex ^.*topic_regex.*\n");
|
|
768
|
+
test_consumer_subscribe(rk, "^.*topic_regex.*");
|
|
769
|
+
if (!test_consumer_group_protocol_classic()) {
|
|
770
|
+
/** Regex matching is async on the broker side for KIP-848
|
|
771
|
+
* protocol. */
|
|
772
|
+
rd_sleep(5);
|
|
773
|
+
}
|
|
774
|
+
/* Wait for assignment */
|
|
775
|
+
await_assignment("Assignment for topic1 and topic2", rk, queue, 2,
|
|
776
|
+
topic1, 4, topic2, 4);
|
|
777
|
+
|
|
778
|
+
/* Unsubscribe from regex ^.*topic_regex.* */
|
|
779
|
+
TEST_SAY("Unsubscribing from regex ^.*topic_regex.*\n");
|
|
780
|
+
rd_kafka_unsubscribe(rk);
|
|
781
|
+
/* Wait for revocation */
|
|
782
|
+
await_revoke("Revocation after unsubscribing", rk, queue);
|
|
783
|
+
|
|
784
|
+
/* Subscribe to regex ^.*topic_regex.* and topic_a literal */
|
|
785
|
+
TEST_SAY("Subscribing to regex ^.*topic_regex.* and topic_a\n");
|
|
786
|
+
test_consumer_subscribe_multi(rk, 2, "^.*topic_regex.*", topic_a);
|
|
787
|
+
/* Wait for assignment */
|
|
788
|
+
if (test_consumer_group_protocol_classic()) {
|
|
789
|
+
await_assignment("Assignment for topic1, topic2 and topic_a",
|
|
790
|
+
rk, queue, 3, topic1, 4, topic2, 4, topic_a,
|
|
791
|
+
2);
|
|
792
|
+
} else {
|
|
793
|
+
/* KIP-848 broker is assigning literal topics first in 1 HB call
|
|
794
|
+
* and all the matched ones in later HB call*/
|
|
795
|
+
await_assignment("Assignment for topic_a", rk, queue, 1,
|
|
796
|
+
topic_a, 2);
|
|
797
|
+
await_assignment("Assignment for topic1 and topic2", rk, queue,
|
|
798
|
+
2, topic1, 4, topic2, 4);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/* Unsubscribe */
|
|
802
|
+
TEST_SAY("Unsubscribing\n");
|
|
803
|
+
rd_kafka_unsubscribe(rk);
|
|
804
|
+
await_revoke("Revocation after unsubscribing", rk, queue);
|
|
805
|
+
|
|
806
|
+
/* Cleanup */
|
|
807
|
+
test_delete_topic(rk, topic1);
|
|
808
|
+
test_delete_topic(rk, topic2);
|
|
809
|
+
test_delete_topic(rk, topic_a);
|
|
810
|
+
|
|
811
|
+
test_consumer_close(rk);
|
|
812
|
+
rd_kafka_queue_destroy(queue);
|
|
813
|
+
|
|
814
|
+
rd_kafka_destroy(rk);
|
|
815
|
+
|
|
816
|
+
rd_free(topic1);
|
|
817
|
+
rd_free(topic2);
|
|
818
|
+
rd_free(topic_a);
|
|
819
|
+
rd_free(group);
|
|
820
|
+
|
|
821
|
+
SUB_TEST_PASS();
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* @brief Create many topics and apply several subscription
|
|
826
|
+
* updates, unsubscribing and re-subscribing too.
|
|
827
|
+
* After changing some subscriptions verifies that the assignment
|
|
828
|
+
* corresponds to last one.
|
|
829
|
+
*
|
|
830
|
+
* @param with_rebalance_cb Use a rebalance callback to perform the assignment.
|
|
831
|
+
* It needs to poll the consumer when awaiting for the
|
|
832
|
+
* assignment in this case.
|
|
833
|
+
*/
|
|
834
|
+
static void do_test_subscribe_many_updates(rd_bool_t with_rebalance_cb) {
|
|
835
|
+
#define TOPIC_CNT 100
|
|
836
|
+
char *topics[TOPIC_CNT] = {0};
|
|
837
|
+
char *topic;
|
|
838
|
+
char *group;
|
|
839
|
+
size_t i;
|
|
840
|
+
rd_kafka_t *rk;
|
|
841
|
+
rd_kafka_conf_t *conf;
|
|
842
|
+
const int partition_cnt = 4;
|
|
843
|
+
|
|
844
|
+
SUB_TEST("%s", with_rebalance_cb ? "with rebalance callback"
|
|
845
|
+
: "without rebalance callback");
|
|
846
|
+
|
|
847
|
+
RD_ARRAY_FOREACH_INDEX(topic, topics, i) {
|
|
848
|
+
char topic_i[17];
|
|
849
|
+
rd_snprintf(topic_i, sizeof(topic_i), "topic%" PRIusz, i);
|
|
850
|
+
topics[i] = rd_strdup(test_mk_topic_name(topic_i, 1));
|
|
851
|
+
};
|
|
852
|
+
group = topics[0];
|
|
853
|
+
|
|
854
|
+
test_conf_init(&conf, NULL, 60);
|
|
855
|
+
if (with_rebalance_cb)
|
|
856
|
+
rd_kafka_conf_set_rebalance_cb(conf, test_rebalance_cb);
|
|
857
|
+
rk = test_create_consumer(group, NULL, conf, NULL);
|
|
858
|
+
|
|
859
|
+
TEST_SAY("Creating %d topics\n", TOPIC_CNT);
|
|
860
|
+
TEST_CALL_ERR__(test_CreateTopics_simple(rk, NULL, topics, TOPIC_CNT,
|
|
861
|
+
partition_cnt, NULL));
|
|
862
|
+
test_wait_topic_exists(rk, topics[TOPIC_CNT - 1], 5000);
|
|
863
|
+
/* Give the cluster some more time to propagate metadata
|
|
864
|
+
* for TOPICS_CNT topics */
|
|
865
|
+
rd_sleep(1);
|
|
866
|
+
|
|
867
|
+
RD_ARRAY_FOREACH_INDEX(topic, topics, i) {
|
|
868
|
+
const int max_subscription_size = 5;
|
|
869
|
+
size_t j;
|
|
870
|
+
int k;
|
|
871
|
+
int subscription_size =
|
|
872
|
+
RD_MIN(max_subscription_size, TOPIC_CNT - i);
|
|
873
|
+
int expected_assignment_cnt = subscription_size * partition_cnt;
|
|
874
|
+
rd_kafka_topic_partition_list_t *expected_assignment = NULL;
|
|
875
|
+
|
|
876
|
+
rd_kafka_topic_partition_list_t *subscription =
|
|
877
|
+
rd_kafka_topic_partition_list_new(subscription_size);
|
|
878
|
+
rd_bool_t check_expected_assignment =
|
|
879
|
+
(i % 5 == 0 || i == TOPIC_CNT - 1);
|
|
880
|
+
rd_bool_t do_unsubscribe = i % 7 == 0;
|
|
881
|
+
|
|
882
|
+
if (check_expected_assignment)
|
|
883
|
+
expected_assignment = rd_kafka_topic_partition_list_new(
|
|
884
|
+
expected_assignment_cnt);
|
|
885
|
+
|
|
886
|
+
for (j = i; j < i + subscription_size; j++) {
|
|
887
|
+
rd_kafka_topic_partition_list_add(
|
|
888
|
+
subscription, topics[j], RD_KAFKA_PARTITION_UA);
|
|
889
|
+
/* We unsubscribe every 7 iteration and
|
|
890
|
+
* we check assignments every 5 iteration so
|
|
891
|
+
* at 7 * 5 we unsubscribe and check that assignment
|
|
892
|
+
* is empty. */
|
|
893
|
+
if (check_expected_assignment && !do_unsubscribe)
|
|
894
|
+
for (k = 0; k < partition_cnt; k++)
|
|
895
|
+
rd_kafka_topic_partition_list_add(
|
|
896
|
+
expected_assignment, topics[j], k);
|
|
897
|
+
}
|
|
898
|
+
TEST_CALL_ERR__(rd_kafka_subscribe(rk, subscription));
|
|
899
|
+
rd_kafka_topic_partition_list_destroy(subscription);
|
|
900
|
+
|
|
901
|
+
if (do_unsubscribe)
|
|
902
|
+
TEST_CALL_ERR__(rd_kafka_unsubscribe(rk));
|
|
903
|
+
if (check_expected_assignment) {
|
|
904
|
+
test_consumer_wait_assignment_topic_partition_list(
|
|
905
|
+
rk,
|
|
906
|
+
/* poll when we have a rebalance callback */
|
|
907
|
+
with_rebalance_cb, expected_assignment, 30000);
|
|
908
|
+
rd_kafka_topic_partition_list_destroy(
|
|
909
|
+
expected_assignment);
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
TEST_CALL_ERR__(
|
|
914
|
+
test_DeleteTopics_simple(rk, NULL, topics, TOPIC_CNT, NULL));
|
|
915
|
+
RD_ARRAY_FOREACH_INDEX(topic, topics, i) {
|
|
916
|
+
rd_free(topic);
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
test_consumer_close(rk);
|
|
920
|
+
rd_kafka_destroy(rk);
|
|
921
|
+
|
|
922
|
+
SUB_TEST_PASS();
|
|
923
|
+
#undef TOPIC_CNT
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
int main_0045_subscribe_update(int argc, char **argv) {
|
|
927
|
+
|
|
928
|
+
if (!test_can_create_topics(1))
|
|
929
|
+
return 0;
|
|
930
|
+
|
|
931
|
+
do_test_regex();
|
|
932
|
+
|
|
933
|
+
return 0;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
int main_0045_subscribe_update_non_exist_and_partchange(int argc, char **argv) {
|
|
937
|
+
|
|
938
|
+
do_test_non_exist_and_partchange();
|
|
939
|
+
|
|
940
|
+
return 0;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
int main_0045_subscribe_update_topic_remove(int argc, char **argv) {
|
|
944
|
+
|
|
945
|
+
if (!test_can_create_topics(1))
|
|
946
|
+
return 0;
|
|
947
|
+
|
|
948
|
+
do_test_topic_remove();
|
|
949
|
+
|
|
950
|
+
return 0;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
int main_0045_subscribe_update_mock(int argc, char **argv) {
|
|
955
|
+
TEST_SKIP_MOCK_CLUSTER(0);
|
|
956
|
+
|
|
957
|
+
do_test_regex_many_mock("range", rd_false);
|
|
958
|
+
do_test_regex_many_mock("cooperative-sticky", rd_false);
|
|
959
|
+
do_test_regex_many_mock("cooperative-sticky", rd_true);
|
|
960
|
+
|
|
961
|
+
return 0;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
int main_0045_resubscribe_with_regex(int argc, char **argv) {
|
|
965
|
+
do_test_resubscribe_with_regex();
|
|
966
|
+
return 0;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
int main_0045_subscribe_many_updates(int argc, char **argv) {
|
|
970
|
+
do_test_subscribe_many_updates(rd_false);
|
|
971
|
+
do_test_subscribe_many_updates(rd_true);
|
|
972
|
+
return 0;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
int main_0045_subscribe_update_racks_mock(int argc, char **argv) {
|
|
976
|
+
int use_replica_rack = 0;
|
|
977
|
+
int use_client_rack = 0;
|
|
978
|
+
|
|
979
|
+
TEST_SKIP_MOCK_CLUSTER(0);
|
|
980
|
+
|
|
981
|
+
/* KIP 848 Mock broker assignor isn't rack-aware. */
|
|
982
|
+
if (!test_consumer_group_protocol_classic()) {
|
|
983
|
+
TEST_SKIP("Test meaningful only with classic protocol\n");
|
|
984
|
+
return 0;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
for (use_replica_rack = 0; use_replica_rack < 2; use_replica_rack++) {
|
|
988
|
+
for (use_client_rack = 0; use_client_rack < 2;
|
|
989
|
+
use_client_rack++) {
|
|
990
|
+
do_test_replica_rack_change_mock(
|
|
991
|
+
"range", rd_true /* use_regex */, use_client_rack,
|
|
992
|
+
use_replica_rack);
|
|
993
|
+
do_test_replica_rack_change_mock(
|
|
994
|
+
"range", rd_true /* use_regex */, use_client_rack,
|
|
995
|
+
use_replica_rack);
|
|
996
|
+
do_test_replica_rack_change_mock(
|
|
997
|
+
"cooperative-sticky", rd_true /* use_regex */,
|
|
998
|
+
use_client_rack, use_replica_rack);
|
|
999
|
+
do_test_replica_rack_change_mock(
|
|
1000
|
+
"cooperative-sticky", rd_true /* use_regex */,
|
|
1001
|
+
use_client_rack, use_replica_rack);
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
/* Do not test with range assignor (yet) since it does not do
|
|
1005
|
+
* rack aware assignment properly with the NULL rack, even for
|
|
1006
|
+
* the Java client. */
|
|
1007
|
+
do_test_replica_rack_change_leader_no_rack_mock("cooperative-sticky");
|
|
1008
|
+
|
|
1009
|
+
return 0;
|
|
1010
|
+
}
|