rdkafka 0.22.2 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +63 -3
  3. data/Gemfile +8 -0
  4. data/Gemfile.lint +14 -0
  5. data/Gemfile.lint.lock +123 -0
  6. data/README.md +19 -14
  7. data/Rakefile +21 -21
  8. data/bin/verify_kafka_warnings +39 -0
  9. data/dist/{librdkafka-2.8.0.tar.gz → librdkafka-2.14.0.tar.gz} +0 -0
  10. data/docker-compose-ssl.yml +35 -0
  11. data/docker-compose.yml +2 -2
  12. data/ext/Rakefile +27 -27
  13. data/lib/rdkafka/abstract_handle.rb +23 -5
  14. data/lib/rdkafka/admin/acl_binding_result.rb +5 -5
  15. data/lib/rdkafka/admin/config_resource_binding_result.rb +1 -0
  16. data/lib/rdkafka/admin/create_acl_handle.rb +7 -4
  17. data/lib/rdkafka/admin/create_acl_report.rb +3 -2
  18. data/lib/rdkafka/admin/create_partitions_handle.rb +8 -5
  19. data/lib/rdkafka/admin/create_partitions_report.rb +1 -0
  20. data/lib/rdkafka/admin/create_topic_handle.rb +8 -5
  21. data/lib/rdkafka/admin/create_topic_report.rb +3 -0
  22. data/lib/rdkafka/admin/delete_acl_handle.rb +9 -6
  23. data/lib/rdkafka/admin/delete_acl_report.rb +5 -3
  24. data/lib/rdkafka/admin/delete_groups_handle.rb +10 -5
  25. data/lib/rdkafka/admin/delete_groups_report.rb +3 -0
  26. data/lib/rdkafka/admin/delete_topic_handle.rb +8 -5
  27. data/lib/rdkafka/admin/delete_topic_report.rb +3 -0
  28. data/lib/rdkafka/admin/describe_acl_handle.rb +9 -6
  29. data/lib/rdkafka/admin/describe_acl_report.rb +5 -3
  30. data/lib/rdkafka/admin/describe_configs_handle.rb +7 -4
  31. data/lib/rdkafka/admin/describe_configs_report.rb +7 -1
  32. data/lib/rdkafka/admin/incremental_alter_configs_handle.rb +7 -4
  33. data/lib/rdkafka/admin/incremental_alter_configs_report.rb +7 -1
  34. data/lib/rdkafka/admin/list_offsets_handle.rb +36 -0
  35. data/lib/rdkafka/admin/list_offsets_report.rb +51 -0
  36. data/lib/rdkafka/admin.rb +301 -135
  37. data/lib/rdkafka/bindings.rb +199 -110
  38. data/lib/rdkafka/callbacks.rb +124 -21
  39. data/lib/rdkafka/config.rb +81 -33
  40. data/lib/rdkafka/consumer/headers.rb +3 -2
  41. data/lib/rdkafka/consumer/message.rb +12 -11
  42. data/lib/rdkafka/consumer/partition.rb +8 -4
  43. data/lib/rdkafka/consumer/topic_partition_list.rb +21 -17
  44. data/lib/rdkafka/consumer.rb +397 -45
  45. data/lib/rdkafka/defaults.rb +106 -0
  46. data/lib/rdkafka/error.rb +40 -14
  47. data/lib/rdkafka/helpers/oauth.rb +45 -13
  48. data/lib/rdkafka/helpers/time.rb +5 -0
  49. data/lib/rdkafka/metadata.rb +45 -21
  50. data/lib/rdkafka/native_kafka.rb +89 -4
  51. data/lib/rdkafka/producer/delivery_handle.rb +5 -5
  52. data/lib/rdkafka/producer/delivery_report.rb +10 -6
  53. data/lib/rdkafka/producer/partitions_count_cache.rb +29 -19
  54. data/lib/rdkafka/producer.rb +168 -82
  55. data/lib/rdkafka/version.rb +6 -3
  56. data/lib/rdkafka.rb +3 -0
  57. data/package-lock.json +331 -0
  58. data/package.json +9 -0
  59. data/rdkafka.gemspec +57 -36
  60. data/renovate.json +29 -24
  61. metadata +29 -124
  62. data/.github/CODEOWNERS +0 -3
  63. data/.github/FUNDING.yml +0 -1
  64. data/.github/workflows/ci_linux_x86_64_gnu.yml +0 -271
  65. data/.github/workflows/ci_linux_x86_64_musl.yml +0 -194
  66. data/.github/workflows/ci_macos_arm64.yml +0 -284
  67. data/.github/workflows/push_linux_x86_64_gnu.yml +0 -65
  68. data/.github/workflows/push_linux_x86_64_musl.yml +0 -79
  69. data/.github/workflows/push_macos_arm64.yml +0 -54
  70. data/.github/workflows/push_ruby.yml +0 -37
  71. data/.github/workflows/verify-action-pins.yml +0 -16
  72. data/.gitignore +0 -14
  73. data/.rspec +0 -2
  74. data/.ruby-gemset +0 -1
  75. data/.ruby-version +0 -1
  76. data/.yardopts +0 -2
  77. data/ext/README.md +0 -19
  78. data/ext/build_common.sh +0 -361
  79. data/ext/build_linux_x86_64_gnu.sh +0 -306
  80. data/ext/build_linux_x86_64_musl.sh +0 -763
  81. data/ext/build_macos_arm64.sh +0 -550
  82. data/spec/rdkafka/abstract_handle_spec.rb +0 -117
  83. data/spec/rdkafka/admin/create_acl_handle_spec.rb +0 -56
  84. data/spec/rdkafka/admin/create_acl_report_spec.rb +0 -18
  85. data/spec/rdkafka/admin/create_topic_handle_spec.rb +0 -52
  86. data/spec/rdkafka/admin/create_topic_report_spec.rb +0 -16
  87. data/spec/rdkafka/admin/delete_acl_handle_spec.rb +0 -85
  88. data/spec/rdkafka/admin/delete_acl_report_spec.rb +0 -72
  89. data/spec/rdkafka/admin/delete_topic_handle_spec.rb +0 -52
  90. data/spec/rdkafka/admin/delete_topic_report_spec.rb +0 -16
  91. data/spec/rdkafka/admin/describe_acl_handle_spec.rb +0 -85
  92. data/spec/rdkafka/admin/describe_acl_report_spec.rb +0 -73
  93. data/spec/rdkafka/admin_spec.rb +0 -971
  94. data/spec/rdkafka/bindings_spec.rb +0 -199
  95. data/spec/rdkafka/callbacks_spec.rb +0 -20
  96. data/spec/rdkafka/config_spec.rb +0 -258
  97. data/spec/rdkafka/consumer/headers_spec.rb +0 -73
  98. data/spec/rdkafka/consumer/message_spec.rb +0 -139
  99. data/spec/rdkafka/consumer/partition_spec.rb +0 -57
  100. data/spec/rdkafka/consumer/topic_partition_list_spec.rb +0 -248
  101. data/spec/rdkafka/consumer_spec.rb +0 -1274
  102. data/spec/rdkafka/error_spec.rb +0 -89
  103. data/spec/rdkafka/metadata_spec.rb +0 -79
  104. data/spec/rdkafka/native_kafka_spec.rb +0 -130
  105. data/spec/rdkafka/producer/delivery_handle_spec.rb +0 -45
  106. data/spec/rdkafka/producer/delivery_report_spec.rb +0 -25
  107. data/spec/rdkafka/producer/partitions_count_cache_spec.rb +0 -359
  108. data/spec/rdkafka/producer_spec.rb +0 -1345
  109. data/spec/spec_helper.rb +0 -195
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6bdfd8912cec56ebe8303d0ad14f3ab7ab2e5e0565e9418a6265a0e48172bc31
4
- data.tar.gz: 646f8a174c1019a0417a571f5894c745701c5d670a0585beb40200a2ffe08193
3
+ metadata.gz: d818b1dce30cffe7b01f9961f05016b70bd99c823f487b3a2c075d335ab31dab
4
+ data.tar.gz: 5bfd08ae7392e5d13f7d06b4dc366515aacbd995d139b19a82dcc74b4324eaab
5
5
  SHA512:
6
- metadata.gz: 9d0711b10d02a1c6792fb21206d7729c958fadc186da5b6d8382d69b0d98183cddf23c123ea1602dd890f39603cd44341b864726c4a737966148fffb7e5e5dbd
7
- data.tar.gz: deeacf4c205c164d2bd2d786f4a512f62caf8aeda6d6fcc11c24d2d665f4b7bd0a7f44447dfa1ebffc1fe54e7a9cdf36c7bbd4ae71c01e167b46b36a298d7482
6
+ metadata.gz: b022eff9faf7d80689e17f832fc1017c395c3463100884fcd3c2fb3610a546cf5bf62362b6f2766ef3de13cf2c4ba1b0d6322dcd1908a38ab2db25a8530a3fda
7
+ data.tar.gz: f489a965325b6c7ab4faa6430b4fdc4912d9223e0cdf623df865e54f4c2baeae8e3d09f167f478d94b77b6f73ddad506b5b7d4f3098dc79c1a3dc58f85ebd941
data/CHANGELOG.md CHANGED
@@ -1,9 +1,69 @@
1
1
  # Rdkafka Changelog
2
2
 
3
+ ## 0.27.0 (2026-05-07)
4
+ - [Feature] Add `Consumer#poll_batch(timeout_ms, max_items:)` and `Consumer#poll_batch_nb(timeout_ms, max_items:)` for batch message polling via `rd_kafka_consume_batch_queue`.
5
+ - [Feature] Add `Config#describe_properties` to dump all librdkafka configuration properties (including defaults and hidden properties) as a Hash via `rd_kafka_conf_dump`.
6
+ - [Enhancement] Bump librdkafka to `2.14.0`
7
+ - [Fix] Fix resource leak in `Admin#describe_configs` and `Admin#incremental_alter_configs` where `admin_options_ptr` and `queue_ptr` were not destroyed in the ensure block.
8
+ - [Fix] Fix leaked queue reference in `Config#native_kafka` where `rd_kafka_queue_get_main` return value was not destroyed after passing to `rd_kafka_set_log_queue`.
9
+ - [Fix] Fix native topic partition list leak in `Consumer#position` where `tpl` was never destroyed.
10
+
11
+ ## 0.26.0 (2026-04-02)
12
+ - [Enhancement] Bump librdkafka to `2.13.2`
13
+ - [Enhancement] Embed a per-file SPEC_HASH in test topic and consumer group names for tracing Kafka warnings back to specific spec files.
14
+ - [Fix] Register `ObjectSpace.define_finalizer` in `Rdkafka::Consumer` to prevent segfaults when a consumer is GC'd without being explicitly closed (jturkel).
15
+ - [Fix] Remove dead `#finalizer` instance methods from `Consumer` and `Admin` that could never work as GC finalizers.
16
+ - [Fix] Prevent cascading test failures in admin specs when a single handle leaks into the registry.
17
+ - [Feature] Extend `Rdkafka::RdkafkaError` with `instance_name` attribute containing the `rd_kafka_name` for tying errors back to specific native Kafka instances (#181).
18
+
19
+ ## 0.25.1 (2026-02-26)
20
+ - [Feature] Support `rd_kafka_ListOffsets` admin API for querying partition offsets by specification (earliest, latest, max_timestamp, or by timestamp) without requiring a consumer group (#613).
21
+ - [Enhancement] Use native ARM64 runners instead of QEMU emulation for Alpine musl aarch64 builds, improving build performance and reliability.
22
+ - [Enhancement] Enable parallel compilation (`make -j$(nproc)`) for ARM64 Alpine musl builds.
23
+ - [Enhancement] Add file descriptor API for fiber scheduler integration. Expose `enable_queue_io_events` and `enable_background_queue_io_events` on `Consumer`, `Producer`, and `Admin` to enable non-blocking monitoring with select/poll/epoll for integration with Ruby fiber schedulers (Falcon, Async) and custom event loops.
24
+ - [Enhancement] Add non-blocking poll methods (`poll_nb`, `events_poll_nb`) on `Consumer` that skip GVL release for efficient fiber scheduler integration when using `poll(0)`.
25
+ - [Enhancement] Add `events_poll_nb_each` method on `Producer`, `Consumer`, and `Admin` for polling events in a single GVL/mutex session. Yields count after each iteration, caller returns `:stop` to break.
26
+ - [Enhancement] Add `poll_nb_each` method on `Consumer` for non-blocking message polling with proper resource cleanup, yielding each message and supporting early termination via `:stop` return value.
27
+
28
+ ## 0.25.0 (2026-01-20)
29
+ - **[Deprecation]** `AbstractHandle#wait` parameter `max_wait_timeout:` (seconds) is deprecated in favor of `max_wait_timeout_ms:` (milliseconds). The old parameter still works but will be removed in v1.0.0.
30
+ - **[Deprecation]** `PartitionsCountCache` constructor parameter `ttl` (seconds) is deprecated in favor of `ttl_ms:` (milliseconds). The old parameter still works but will be removed in v1.0.0.
31
+ - [Enhancement] Extract all timeout defaults to `Rdkafka::Defaults` module for discoverability and per-call overrides (#310). All time-related values are now in milliseconds for consistency.
32
+ - [Enhancement] Add `timeout_ms` parameter to `Consumer#each` for configurable poll timeout.
33
+ - [Enhancement] Extract non-time configuration values (`METADATA_MAX_RETRIES`, `PARTITIONS_COUNT_CACHE_TTL_MS`) to `Rdkafka::Defaults` module.
34
+ - [Enhancement] Bump librdkafka to `2.12.1`
35
+ - [Enhancement] Add descriptive error messages for glibc compatibility issues with instructions for resolution (#654)
36
+ - [Enhancement] Replace magic numbers with named constants throughout codebase for improved readability and maintainability
37
+
38
+ ## 0.24.2 (2025-10-31)
39
+ - [Enhancement] Force lock FFI to 1.17.1 or higher to include critical bug fixes around GCC, write barriers, and thread restarts for forks.
40
+ - [Fix] Fix for Core dump when providing extensions to oauthbearer_set_token (dssjoblom)
41
+
42
+ ## 0.24.1 (2025-10-10)
43
+ - [Fix] Fix Github Action Ruby reference preventing non-compiled releases.
44
+
45
+ ## 0.24.0 (2025-10-10)
46
+ - [Enhancement] Bump librdkafka to `2.11.1`
47
+
48
+ ## 0.23.1 (2025-09-25)
49
+ - [Enhancement] Improve sigstore attestation for precompiled releases.
50
+ - [Fix] Fix incorrectly set default SSL certs dir.
51
+ - [Fix] Disable OpenSSL Heartbeats during compilation.
52
+
53
+ ## 0.23.0 (2025-09-04)
54
+ - **[EOL]** Drop support for Ruby 3.1 to move forward with the fiber scheduler work.
55
+ - [Enhancement] Bump librdkafka to `2.11.0`
56
+ - [Enhancement] Support explicit Debian testing due to lib issues.
57
+ - [Enhancement] Support ARM64 Gnu precompilation.
58
+ - [Enhancement] Improve what symbols are exposed outside of the precompiled extensions.
59
+ - [Enhancement] Introduce an integration suite layer for non RSpec specs execution.
60
+ - [Fix] Add `json` gem as a dependency (was missing but used).
61
+
3
62
  ## 0.22.2 (2025-07-21)
4
63
  - [Enhancement] Drastically increase number of platforms in the integration suite
5
64
  - [Fix] Support Ubuntu `22.04` and older Alpine precompiled versions
6
65
  - [Fix] FFI::DynamicLibrary.load_library': Could not open library
66
+ - [Change] Add new CI action to trigger auto-doc refresh.
7
67
 
8
68
  ## 0.22.1 (2025-07-17)
9
69
  - [Fix] Fix `Rakefile` being available in the precompiled versions causing build failures.
@@ -38,7 +98,7 @@
38
98
  - [Patch] Retire no longer needed cooperative-sticky patch.
39
99
 
40
100
  ## 0.19.0 (2024-10-01)
41
- - **[Breaking]** Drop Ruby 3.0 support
101
+ - **[EOL]** Drop Ruby 3.0 support
42
102
  - [Enhancement] Update `librdkafka` to `2.5.3`
43
103
  - [Enhancement] Use default oauth callback if none is passed (bachmanity1)
44
104
  - [Fix] Fix incorrectly behaving CI on failures.
@@ -62,7 +122,7 @@
62
122
  - [Fix] Switch to local release of librdkafka to mitigate its unavailability.
63
123
 
64
124
  ## 0.16.0 (2024-06-13)
65
- - **[Breaking]** Retire support for Ruby 2.7.
125
+ - **[EOL]** Retire support for Ruby 2.7.
66
126
  - **[Breaking]** Messages without headers returned by `#poll` contain frozen empty hash.
67
127
  - **[Breaking]** `HashWithSymbolKeysTreatedLikeStrings` has been removed so headers are regular hashes with string keys.
68
128
  - **[Feature]** Support incremental config describe + alter API.
@@ -123,7 +183,7 @@
123
183
  - [Fix] Reference to Opaque is not released when Admin, Consumer or Producer is closed (mensfeld)
124
184
  - [Fix] Trigger `#poll` on native kafka creation to handle oauthbearer cb (mensfeld)
125
185
  - [Fix] `#flush` does not handle the timeouts errors by making it return `true` if all flushed or `false` if failed. We do **not** raise an exception here to keep it backwards compatible (mensfeld)
126
- - [Change] Remove support for Ruby 2.6 due to it being EOL and WeakMap incompatibilities (mensfeld)
186
+ - **[EOL]** Remove support for Ruby 2.6 due to it being EOL and WeakMap incompatibilities (mensfeld)
127
187
  - [Change] Update Kafka Docker with Confluent KRaft (mensfeld)
128
188
  - [Change] Update librdkafka repo reference from edenhill to confluentinc (mensfeld)
129
189
 
data/Gemfile CHANGED
@@ -3,3 +3,11 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
+
7
+ group :development do
8
+ gem "ostruct"
9
+ gem "pry"
10
+ gem "rspec"
11
+ gem "simplecov"
12
+ gem "warning"
13
+ end
data/Gemfile.lint ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Documentation linting
6
+ gem "yard-lint"
7
+
8
+ # Code style (StandardRB via RuboCop)
9
+ gem "standard"
10
+ gem "standard-performance"
11
+ gem "rubocop-performance"
12
+ gem "rubocop-rspec"
13
+ gem "standard-rspec"
14
+ gem "rubocop-thread_safety"
data/Gemfile.lint.lock ADDED
@@ -0,0 +1,123 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ ast (2.4.3)
5
+ json (2.18.0)
6
+ language_server-protocol (3.17.0.5)
7
+ lint_roller (1.1.0)
8
+ parallel (1.27.0)
9
+ parser (3.3.10.1)
10
+ ast (~> 2.4.1)
11
+ racc
12
+ prism (1.8.0)
13
+ racc (1.8.1)
14
+ rainbow (3.1.1)
15
+ regexp_parser (2.11.3)
16
+ rubocop (1.82.1)
17
+ json (~> 2.3)
18
+ language_server-protocol (~> 3.17.0.2)
19
+ lint_roller (~> 1.1.0)
20
+ parallel (~> 1.10)
21
+ parser (>= 3.3.0.2)
22
+ rainbow (>= 2.2.2, < 4.0)
23
+ regexp_parser (>= 2.9.3, < 3.0)
24
+ rubocop-ast (>= 1.48.0, < 2.0)
25
+ ruby-progressbar (~> 1.7)
26
+ unicode-display_width (>= 2.4.0, < 4.0)
27
+ rubocop-ast (1.49.0)
28
+ parser (>= 3.3.7.2)
29
+ prism (~> 1.7)
30
+ rubocop-capybara (2.22.1)
31
+ lint_roller (~> 1.1)
32
+ rubocop (~> 1.72, >= 1.72.1)
33
+ rubocop-factory_bot (2.28.0)
34
+ lint_roller (~> 1.1)
35
+ rubocop (~> 1.72, >= 1.72.1)
36
+ rubocop-performance (1.26.1)
37
+ lint_roller (~> 1.1)
38
+ rubocop (>= 1.75.0, < 2.0)
39
+ rubocop-ast (>= 1.47.1, < 2.0)
40
+ rubocop-rspec (3.9.0)
41
+ lint_roller (~> 1.1)
42
+ rubocop (~> 1.81)
43
+ rubocop-rspec_rails (2.32.0)
44
+ lint_roller (~> 1.1)
45
+ rubocop (~> 1.72, >= 1.72.1)
46
+ rubocop-rspec (~> 3.5)
47
+ rubocop-thread_safety (0.7.3)
48
+ lint_roller (~> 1.1)
49
+ rubocop (~> 1.72, >= 1.72.1)
50
+ rubocop-ast (>= 1.44.0, < 2.0)
51
+ ruby-progressbar (1.13.0)
52
+ standard (1.53.0)
53
+ language_server-protocol (~> 3.17.0.2)
54
+ lint_roller (~> 1.0)
55
+ rubocop (~> 1.82.0)
56
+ standard-custom (~> 1.0.0)
57
+ standard-performance (~> 1.8)
58
+ standard-custom (1.0.2)
59
+ lint_roller (~> 1.0)
60
+ rubocop (~> 1.50)
61
+ standard-performance (1.9.0)
62
+ lint_roller (~> 1.1)
63
+ rubocop-performance (~> 1.26.0)
64
+ standard-rspec (0.3.1)
65
+ lint_roller (>= 1.0)
66
+ rubocop-capybara (~> 2.22)
67
+ rubocop-factory_bot (~> 2.27)
68
+ rubocop-rspec (~> 3.5)
69
+ rubocop-rspec_rails (~> 2.31)
70
+ unicode-display_width (3.2.0)
71
+ unicode-emoji (~> 4.1)
72
+ unicode-emoji (4.2.0)
73
+ yard (0.9.38)
74
+ yard-lint (1.4.0)
75
+ yard (~> 0.9)
76
+ zeitwerk (~> 2.6)
77
+ zeitwerk (2.7.4)
78
+
79
+ PLATFORMS
80
+ ruby
81
+ x86_64-linux
82
+
83
+ DEPENDENCIES
84
+ rubocop-performance
85
+ rubocop-rspec
86
+ rubocop-thread_safety
87
+ standard
88
+ standard-performance
89
+ standard-rspec
90
+ yard-lint
91
+
92
+ CHECKSUMS
93
+ ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
94
+ json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
95
+ language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
96
+ lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
97
+ parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
98
+ parser (3.3.10.1) sha256=06f6a725d2cd91e5e7f2b7c32ba143631e1f7c8ae2fb918fc4cebec187e6a688
99
+ prism (1.8.0) sha256=84453a16ef5530ea62c5f03ec16b52a459575ad4e7b9c2b360fd8ce2c39c1254
100
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
101
+ rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
102
+ regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4
103
+ rubocop (1.82.1) sha256=09f1a6a654a960eda767aebea33e47603080f8e9c9a3f019bf9b94c9cab5e273
104
+ rubocop-ast (1.49.0) sha256=49c3676d3123a0923d333e20c6c2dbaaae2d2287b475273fddee0c61da9f71fd
105
+ rubocop-capybara (2.22.1) sha256=ced88caef23efea53f46e098ff352f8fc1068c649606ca75cb74650970f51c0c
106
+ rubocop-factory_bot (2.28.0) sha256=4b17fc02124444173317e131759d195b0d762844a71a29fe8139c1105d92f0cb
107
+ rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834
108
+ rubocop-rspec (3.9.0) sha256=8fa70a3619408237d789aeecfb9beef40576acc855173e60939d63332fdb55e2
109
+ rubocop-rspec_rails (2.32.0) sha256=4a0d641c72f6ebb957534f539d9d0a62c47abd8ce0d0aeee1ef4701e892a9100
110
+ rubocop-thread_safety (0.7.3) sha256=067cdd52fbf5deffc18995437e45b5194236eaff4f71de3375a1f6052e48f431
111
+ ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
112
+ standard (1.53.0) sha256=f3c9493385db7079d0abce6f7582f553122156997b81258cd361d3480eeacf9c
113
+ standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b
114
+ standard-performance (1.9.0) sha256=49483d31be448292951d80e5e67cdcb576c2502103c7b40aec6f1b6e9c88e3f2
115
+ standard-rspec (0.3.1) sha256=67bc957281cacf24f0d88235ca1bf28a8995265b1a60eb519cd0451858b56a22
116
+ unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
117
+ unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
118
+ yard (0.9.38) sha256=721fb82afb10532aa49860655f6cc2eaa7130889df291b052e1e6b268283010f
119
+ yard-lint (1.4.0) sha256=7dd88fbb08fd77cb840bea899d58812817b36d92291b5693dd0eeb3af9f91f0f
120
+ zeitwerk (2.7.4) sha256=2bef90f356bdafe9a6c2bd32bcd804f83a4f9b8bc27f3600fff051eb3edcec8b
121
+
122
+ BUNDLED WITH
123
+ 4.0.3
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rdkafka
2
2
 
3
- [![Build Status](https://github.com/karafka/rdkafka-ruby/actions/workflows/ci_linux_x86_64_gnu.yml/badge.svg)](https://github.com/karafka/rdkafka-ruby/actions/workflows/ci_linux_x86_64_gnu.yml)
3
+ [![Build Status](https://github.com/karafka/rdkafka-ruby/actions/workflows/ci_linux_ubuntu_x86_64_gnu.yml/badge.svg)](https://github.com/karafka/rdkafka-ruby/actions/workflows/ci_linux_x86_64_gnu.yml)
4
4
  [![Gem Version](https://badge.fury.io/rb/rdkafka.svg)](https://badge.fury.io/rb/rdkafka)
5
5
  [![Join the chat at https://slack.karafka.io](https://raw.githubusercontent.com/karafka/misc/master/slack.svg)](https://slack.karafka.io)
6
6
 
@@ -163,16 +163,21 @@ bundle exec rake produce_messages
163
163
 
164
164
  | rdkafka-ruby | librdkafka | patches |
165
165
  |-|-|-|
166
- | 0.22.x (2025-07-17) | 2.8.0 (2025-01-07) | yes |
167
- | 0.21.x (2025-02-13) | 2.8.0 (2025-01-07) | yes |
168
- | 0.20.0 (2025-01-07) | 2.6.1 (2024-11-18) | yes |
169
- | 0.19.0 (2024-10-01) | 2.5.3 (2024-09-02) | yes |
170
- | 0.18.0 (2024-09-02) | 2.5.0 (2024-06-10) | yes |
171
- | 0.17.0 (2024-08-03) | 2.4.0 (2024-05-07) | no |
172
- | 0.16.0 (2024-06-13) | 2.3.0 (2023-10-25) | no |
173
- | 0.15.0 (2023-12-03) | 2.3.0 (2023-10-25) | no |
174
- | 0.14.0 (2023-11-21) | 2.2.0 (2023-07-12) | no |
175
- | 0.13.0 (2023-07-24) | 2.0.2 (2023-01-20) | no |
176
- | 0.12.0 (2022-06-17) | 1.9.0 (2022-06-16) | no |
177
- | 0.11.0 (2021-11-17) | 1.8.2 (2021-10-18) | no |
178
- | 0.10.0 (2021-09-07) | 1.5.0 (2020-07-20) | no |
166
+ | 0.27.x (2026-05-07) | 2.14.0 (2026-04-01) | yes |
167
+ | 0.26.x (2026-03-30) | 2.13.2 (2026-03-02) | yes |
168
+ | 0.25.x (2026-01-21) | 2.12.1 (2025-10-21) | yes |
169
+ | 0.24.x (2025-10-10) | 2.11.1 (2025-08-18) | yes |
170
+ | 0.23.x (2025-09-04) | 2.11.0 (2025-07-03) | yes |
171
+ | 0.22.x (2025-07-17) | 2.8.0 (2025-01-07) | yes |
172
+ | 0.21.x (2025-02-13) | 2.8.0 (2025-01-07) | yes |
173
+ | 0.20.0 (2025-01-07) | 2.6.1 (2024-11-18) | yes |
174
+ | 0.19.0 (2024-10-01) | 2.5.3 (2024-09-02) | yes |
175
+ | 0.18.0 (2024-09-02) | 2.5.0 (2024-06-10) | yes |
176
+ | 0.17.0 (2024-08-03) | 2.4.0 (2024-05-07) | no |
177
+ | 0.16.0 (2024-06-13) | 2.3.0 (2023-10-25) | no |
178
+ | 0.15.0 (2023-12-03) | 2.3.0 (2023-10-25) | no |
179
+ | 0.14.0 (2023-11-21) | 2.2.0 (2023-07-12) | no |
180
+ | 0.13.0 (2023-07-24) | 2.0.2 (2023-01-20) | no |
181
+ | 0.12.0 (2022-06-17) | 1.9.0 (2022-06-16) | no |
182
+ | 0.11.0 (2021-11-17) | 1.8.2 (2021-10-18) | no |
183
+ | 0.10.0 (2021-09-07) | 1.5.0 (2020-07-20) | no |
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
3
+ require "bundler/gem_tasks"
4
4
  require "./lib/rdkafka"
5
5
 
6
- desc 'Generate some message traffic'
6
+ desc "Generate some message traffic"
7
7
  task :produce_messages do
8
- config = {:"bootstrap.servers" => "localhost:9092"}
8
+ config = { "bootstrap.servers": "localhost:9092" }
9
9
  if ENV["DEBUG"]
10
10
  config[:debug] = "broker,topic,msg"
11
11
  end
@@ -15,24 +15,24 @@ task :produce_messages do
15
15
  100.times do |i|
16
16
  puts "Producing message #{i}"
17
17
  delivery_handles << producer.produce(
18
- topic: "rake_test_topic",
19
- payload: "Payload #{i} from Rake",
20
- key: "Key #{i} from Rake"
18
+ topic: "rake_test_topic",
19
+ payload: "Payload #{i} from Rake",
20
+ key: "Key #{i} from Rake"
21
21
  )
22
22
  end
23
- puts 'Waiting for delivery'
23
+ puts "Waiting for delivery"
24
24
  delivery_handles.each(&:wait)
25
- puts 'Done'
25
+ puts "Done"
26
26
  end
27
27
 
28
- desc 'Consume some messages'
28
+ desc "Consume some messages"
29
29
  task :consume_messages do
30
30
  config = {
31
- :"bootstrap.servers" => "localhost:9092",
32
- :"group.id" => "rake_test",
33
- :"enable.partition.eof" => false,
34
- :"auto.offset.reset" => "earliest",
35
- :"statistics.interval.ms" => 10_000
31
+ "bootstrap.servers": "localhost:9092",
32
+ "group.id": "rake_test",
33
+ "enable.partition.eof": false,
34
+ "auto.offset.reset": "earliest",
35
+ "statistics.interval.ms": 10_000
36
36
  }
37
37
  if ENV["DEBUG"]
38
38
  config[:debug] = "cgrp,topic,fetch"
@@ -40,7 +40,7 @@ task :consume_messages do
40
40
  Rdkafka::Config.statistics_callback = lambda do |stats|
41
41
  puts stats
42
42
  end
43
- consumer = Rdkafka::Config.new(config).consumer
43
+ Rdkafka::Config.new(config).consumer
44
44
  consumer = Rdkafka::Config.new(config).consumer
45
45
  consumer.subscribe("rake_test_topic")
46
46
  consumer.each do |message|
@@ -48,14 +48,14 @@ task :consume_messages do
48
48
  end
49
49
  end
50
50
 
51
- desc 'Hammer down'
51
+ desc "Hammer down"
52
52
  task :load_test do
53
53
  puts "Starting load test"
54
54
 
55
55
  config = Rdkafka::Config.new(
56
- :"bootstrap.servers" => "localhost:9092",
57
- :"group.id" => "load-test",
58
- :"enable.partition.eof" => false
56
+ "bootstrap.servers": "localhost:9092",
57
+ "group.id": "load-test",
58
+ "enable.partition.eof": false
59
59
  )
60
60
 
61
61
  # Create a producer in a thread
@@ -65,9 +65,9 @@ task :load_test do
65
65
  handles = []
66
66
  1000.times do |i|
67
67
  handles.push(producer.produce(
68
- topic: "load_test_topic",
68
+ topic: "load_test_topic",
69
69
  payload: "Payload #{i}",
70
- key: "Key #{i}"
70
+ key: "Key #{i}"
71
71
  ))
72
72
  end
73
73
  handles.each(&:wait)
@@ -0,0 +1,39 @@
1
+ #!/bin/bash
2
+
3
+ # Checks Kafka logs for unsupported warning patterns
4
+ # Only specified warnings are allowed, all others should trigger failure
5
+
6
+ allowed_patterns=(
7
+ "Performing controller activation"
8
+ "registered with feature metadata.version"
9
+ "Replayed TopicRecord for"
10
+ "Replayed PartitionRecord for"
11
+ "Previous leader None and previous leader epoch"
12
+ "Creating new"
13
+ "Unloaded transaction metadata"
14
+ "closing connection"
15
+ "sent a heartbeat request but received error REQUEST_TIMED_OUT"
16
+ "Topic '__consumer_offsets' already exists"
17
+ )
18
+
19
+ # Get all warnings
20
+ warnings=$(docker logs --since=0 kafka | grep "] WARN ")
21
+ exit_code=0
22
+
23
+ while IFS= read -r line; do
24
+ allowed=0
25
+ for pattern in "${allowed_patterns[@]}"; do
26
+ if echo "$line" | grep -q "$pattern"; then
27
+ allowed=1
28
+ break
29
+ fi
30
+ done
31
+
32
+ if [ $allowed -eq 0 ]; then
33
+ echo "Unexpected warning found:"
34
+ echo "$line"
35
+ exit_code=1
36
+ fi
37
+ done <<< "$warnings"
38
+
39
+ exit $exit_code
@@ -0,0 +1,35 @@
1
+ services:
2
+ kafka:
3
+ container_name: kafka
4
+ image: confluentinc/cp-kafka:8.2.0
5
+ ports:
6
+ - 9092:9092 # Support PLAINTEXT so we can run one docker setup for SSL and PLAINTEXT
7
+ - 9093:9093
8
+ volumes:
9
+ - ./ssl:/etc/kafka/secrets
10
+ environment:
11
+ CLUSTER_ID: kafka-docker-cluster-1
12
+ KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
13
+ KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
14
+ KAFKA_PROCESS_ROLES: broker,controller
15
+ KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
16
+ KAFKA_LISTENERS: PLAINTEXT://:9092,SSL://:9093,CONTROLLER://:9094
17
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,SSL:SSL
18
+ KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092,SSL://127.0.0.1:9093
19
+ KAFKA_BROKER_ID: 1
20
+ KAFKA_CONTROLLER_QUORUM_VOTERS: 1@127.0.0.1:9094
21
+ ALLOW_PLAINTEXT_LISTENER: 'yes'
22
+ KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
23
+ KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
24
+ KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
25
+ KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true"
26
+ KAFKA_AUTHORIZER_CLASS_NAME: org.apache.kafka.metadata.authorizer.StandardAuthorizer
27
+
28
+ # SSL Configuration
29
+ KAFKA_SSL_KEYSTORE_FILENAME: kafka.server.keystore.jks
30
+ KAFKA_SSL_KEYSTORE_CREDENTIALS: kafka_keystore_creds
31
+ KAFKA_SSL_KEY_CREDENTIALS: kafka_ssl_key_creds
32
+ KAFKA_SSL_TRUSTSTORE_FILENAME: kafka.server.truststore.jks
33
+ KAFKA_SSL_TRUSTSTORE_CREDENTIALS: kafka_truststore_creds
34
+ KAFKA_SSL_CLIENT_AUTH: none
35
+ KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: ""
data/docker-compose.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  services:
2
2
  kafka:
3
3
  container_name: kafka
4
- image: confluentinc/cp-kafka:8.0.0
4
+ image: confluentinc/cp-kafka:8.2.0
5
5
 
6
6
  ports:
7
7
  - 9092:9092
@@ -18,7 +18,7 @@ services:
18
18
  KAFKA_BROKER_ID: 1
19
19
  KAFKA_CONTROLLER_QUORUM_VOTERS: 1@127.0.0.1:9093
20
20
  ALLOW_PLAINTEXT_LISTENER: 'yes'
21
- KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
21
+ KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
22
22
  KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
23
23
  KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
24
24
  KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true"
data/ext/Rakefile CHANGED
@@ -1,53 +1,53 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../lib/rdkafka/version', __FILE__)
3
+ require File.expand_path("../../lib/rdkafka/version", __FILE__)
4
4
  require "digest"
5
5
  require "fileutils"
6
6
  require "open-uri"
7
7
 
8
- task :default => :clean do
8
+ task default: :clean do
9
9
  # For nix users, nix can't locate the file paths because the packages it's requiring aren't managed by the system but are
10
10
  # managed by nix itself, so using the normal file paths doesn't work for nix users.
11
11
  #
12
12
  # Mini_portile causes an issue because it's dependencies are downloaded on the fly and therefore don't exist/aren't
13
13
  # accessible in the nix environment
14
- if ENV.fetch('RDKAFKA_EXT_PATH', '').empty?
14
+ if ENV.fetch("RDKAFKA_EXT_PATH", "").empty?
15
15
  # Download and compile librdkafka if RDKAFKA_EXT_PATH is not set
16
16
  require "mini_portile2"
17
17
  recipe = MiniPortile.new("librdkafka", Rdkafka::LIBRDKAFKA_VERSION)
18
18
 
19
19
  # Use default homebrew openssl if we're on mac and the directory exists, is not using nix-prepared libraries
20
20
  # and each of flags is not already set
21
- if recipe.host&.include?("darwin") && system("which brew &> /dev/null") && Dir.exist?("#{homebrew_prefix = %x(brew --prefix openssl).strip}") && !ENV.key?("NIX_LDFLAGS")
21
+ if recipe.host&.include?("darwin") && system("which brew &> /dev/null") && Dir.exist?((homebrew_prefix = `brew --prefix openssl`.strip).to_s) && !ENV.key?("NIX_LDFLAGS")
22
22
  ENV["CPPFLAGS"] = "-I#{homebrew_prefix}/include" unless ENV.key?("CPPFLAGS")
23
23
  ENV["LDFLAGS"] = "-L#{homebrew_prefix}/lib" unless ENV.key?("LDFLAGS")
24
24
  end
25
25
 
26
- releases = File.expand_path(File.join(File.dirname(__FILE__), '../dist'))
26
+ releases = File.expand_path(File.join(File.dirname(__FILE__), "../dist"))
27
27
 
28
28
  recipe.files << {
29
- :url => "file://#{releases}/librdkafka-#{Rdkafka::LIBRDKAFKA_VERSION}.tar.gz",
30
- :sha256 => Rdkafka::LIBRDKAFKA_SOURCE_SHA256
29
+ url: "file://#{releases}/librdkafka-#{Rdkafka::LIBRDKAFKA_VERSION}.tar.gz",
30
+ sha256: Rdkafka::LIBRDKAFKA_SOURCE_SHA256
31
31
  }
32
32
  recipe.configure_options = ["--host=#{recipe.host}"]
33
33
 
34
- recipe.patch_files = Dir[File.join(releases, 'patches', "*.patch")].sort
34
+ recipe.patch_files = Dir[File.join(releases, "patches", "*.patch")].sort
35
35
 
36
36
  # Disable using libc regex engine in favor of the embedded one
37
37
  # The default regex engine of librdkafka does not always work exactly as most of the users
38
38
  # would expect, hence this flag allows for changing it to the other one
39
- if ENV.key?('RDKAFKA_DISABLE_REGEX_EXT')
40
- recipe.configure_options << '--disable-regex-ext'
39
+ if ENV.key?("RDKAFKA_DISABLE_REGEX_EXT")
40
+ recipe.configure_options << "--disable-regex-ext"
41
41
  end
42
42
 
43
43
  recipe.cook
44
44
  # Move dynamic library we're interested in
45
- if recipe.host.include?('darwin')
46
- from_extension = '1.dylib'
47
- to_extension = 'dylib'
45
+ if recipe.host.include?("darwin")
46
+ from_extension = "1.dylib"
47
+ to_extension = "dylib"
48
48
  else
49
- from_extension = 'so.1'
50
- to_extension = 'so'
49
+ from_extension = "so.1"
50
+ to_extension = "so"
51
51
  end
52
52
  lib_path = File.join(File.dirname(__FILE__), "ports/#{recipe.host}/librdkafka/#{Rdkafka::LIBRDKAFKA_VERSION}/lib/librdkafka.#{from_extension}")
53
53
  FileUtils.mv(lib_path, File.join(File.dirname(__FILE__), "librdkafka.#{to_extension}"))
@@ -56,12 +56,12 @@ task :default => :clean do
56
56
  FileUtils.rm_rf File.join(File.dirname(__FILE__), "ports")
57
57
  else
58
58
  # Otherwise, copy existing libraries to ./ext
59
- if ENV['RDKAFKA_EXT_PATH'].nil? || ENV['RDKAFKA_EXT_PATH'].empty?
59
+ if ENV["RDKAFKA_EXT_PATH"].nil? || ENV["RDKAFKA_EXT_PATH"].empty?
60
60
  raise "RDKAFKA_EXT_PATH must be set in your nix config when running under nix"
61
61
  end
62
62
  files = [
63
- File.join(ENV['RDKAFKA_EXT_PATH'], 'lib', 'librdkafka.dylib'),
64
- File.join(ENV['RDKAFKA_EXT_PATH'], 'lib', 'librdkafka.so')
63
+ File.join(ENV["RDKAFKA_EXT_PATH"], "lib", "librdkafka.dylib"),
64
+ File.join(ENV["RDKAFKA_EXT_PATH"], "lib", "librdkafka.so")
65
65
  ]
66
66
  files.each { |ext| FileUtils.cp(ext, File.dirname(__FILE__)) if File.exist?(ext) }
67
67
  end
@@ -76,28 +76,28 @@ end
76
76
 
77
77
  namespace :dist do
78
78
  task :dir do
79
- ENV["RDKAFKA_DIST_PATH"] ||= File.expand_path(File.join(File.dirname(__FILE__), '..', 'dist'))
79
+ ENV["RDKAFKA_DIST_PATH"] ||= File.expand_path(File.join(File.dirname(__FILE__), "..", "dist"))
80
80
  end
81
81
 
82
- task :file => "dist:dir" do
82
+ task file: "dist:dir" do
83
83
  ENV["RDKAFKA_DIST_FILE"] ||= File.join(ENV["RDKAFKA_DIST_PATH"], "librdkafka_#{Rdkafka::LIBRDKAFKA_VERSION}.tar.gz")
84
84
  end
85
85
 
86
- task :clean => "dist:file" do
87
- Dir.glob(File.join("#{ENV['RDKAFKA_DIST_PATH']}", "*")).each do |filename|
86
+ task clean: "dist:file" do
87
+ Dir.glob(File.join(ENV["RDKAFKA_DIST_PATH"].to_s, "*")).each do |filename|
88
88
  next if filename.include? ENV["RDKAFKA_DIST_FILE"]
89
89
 
90
90
  FileUtils.rm_rf filename
91
91
  end
92
92
  end
93
93
 
94
- task :download => "dist:file" do
94
+ task download: "dist:file" do
95
95
  version = Rdkafka::LIBRDKAFKA_VERSION
96
96
  librdkafka_download = "https://codeload.github.com/confluentinc/librdkafka/tar.gz/v#{version}"
97
97
 
98
98
  URI.open(librdkafka_download) do |file|
99
99
  filename = ENV["RDKAFKA_DIST_FILE"]
100
- data = file.read
100
+ data = file.read
101
101
 
102
102
  if Digest::SHA256.hexdigest(data) != Rdkafka::LIBRDKAFKA_SOURCE_SHA256
103
103
  raise "SHA256 does not match downloaded file"
@@ -107,7 +107,7 @@ namespace :dist do
107
107
  end
108
108
  end
109
109
 
110
- task :update => %w[dist:download dist:clean]
110
+ task update: %w[dist:download dist:clean]
111
111
  end
112
112
 
113
113
  namespace :build do
@@ -118,8 +118,8 @@ namespace :build do
118
118
 
119
119
  recipe = MiniPortile.new("librdkafka", version)
120
120
  recipe.files << "https://github.com/confluentinc/librdkafka/archive/#{ref}.tar.gz"
121
- recipe.configure_options = ["--host=#{recipe.host}","--enable-static", "--enable-zstd"]
122
- recipe.patch_files = Dir[File.join(releases, 'patches', "*.patch")].sort
121
+ recipe.configure_options = ["--host=#{recipe.host}", "--enable-static", "--enable-zstd"]
122
+ recipe.patch_files = Dir[File.join(releases, "patches", "*.patch")].sort
123
123
  recipe.cook
124
124
 
125
125
  ext = recipe.host.include?("darwin") ? "dylib" : "so"