karafka-rdkafka 0.20.0.rc5-arm64-darwin → 0.21.0-arm64-darwin

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/{ci_linux_x86_64_musl.yml → ci_linux_alpine_x86_64_musl.yml} +63 -71
  3. data/.github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml +264 -0
  4. data/.github/workflows/ci_linux_debian_x86_64_gnu.yml +271 -0
  5. data/.github/workflows/ci_linux_debian_x86_64_gnu_complementary.yml +334 -0
  6. data/.github/workflows/{ci_linux_x86_64_gnu.yml → ci_linux_ubuntu_aarch64_gnu.yml} +78 -56
  7. data/.github/workflows/ci_linux_ubuntu_aarch64_gnu_complementary.yml +295 -0
  8. data/.github/workflows/ci_linux_ubuntu_x86_64_gnu.yml +281 -0
  9. data/.github/workflows/ci_linux_ubuntu_x86_64_gnu_complementary.yml +294 -0
  10. data/.github/workflows/ci_macos_arm64.yml +28 -50
  11. data/.github/workflows/push_linux_aarch64_gnu.yml +65 -0
  12. data/.github/workflows/push_linux_x86_64_gnu.yml +4 -3
  13. data/.github/workflows/push_linux_x86_64_musl.yml +6 -4
  14. data/.github/workflows/push_macos_arm64.yml +3 -3
  15. data/.github/workflows/push_ruby.yml +1 -1
  16. data/.github/workflows/trigger-wiki-refresh.yml +30 -0
  17. data/.github/workflows/verify-action-pins.yml +1 -1
  18. data/.gitignore +1 -0
  19. data/.rspec +1 -0
  20. data/.ruby-version +1 -1
  21. data/CHANGELOG.md +18 -2
  22. data/README.md +48 -147
  23. data/dist/cyrus-sasl-2.1.28.tar.gz +0 -0
  24. data/dist/krb5-1.21.3.tar.gz +0 -0
  25. data/dist/openssl-3.0.16.tar.gz +0 -0
  26. data/dist/zlib-1.3.1.tar.gz +0 -0
  27. data/dist/zstd-1.5.7.tar.gz +0 -0
  28. data/docker-compose-ssl.yml +35 -0
  29. data/ext/build_common.sh +18 -3
  30. data/ext/build_linux_aarch64_gnu.sh +326 -0
  31. data/ext/build_linux_x86_64_gnu.sh +17 -6
  32. data/ext/build_linux_x86_64_musl.sh +18 -8
  33. data/ext/build_macos_arm64.sh +7 -0
  34. data/ext/generate-ssl-certs.sh +109 -0
  35. data/ext/librdkafka.dylib +0 -0
  36. data/karafka-rdkafka.gemspec +3 -1
  37. data/lib/rdkafka/bindings.rb +6 -8
  38. data/lib/rdkafka/config.rb +1 -4
  39. data/lib/rdkafka/consumer.rb +1 -1
  40. data/lib/rdkafka/producer.rb +11 -6
  41. data/lib/rdkafka/version.rb +3 -3
  42. data/spec/integrations/ssl_stress_spec.rb +121 -0
  43. data/spec/{rdkafka → lib/rdkafka}/admin_spec.rb +219 -6
  44. data/spec/{rdkafka → lib/rdkafka}/bindings_spec.rb +0 -24
  45. data/spec/{rdkafka → lib/rdkafka}/config_spec.rb +1 -1
  46. data/spec/{rdkafka → lib/rdkafka}/consumer_spec.rb +50 -6
  47. data/spec/{rdkafka → lib/rdkafka}/metadata_spec.rb +2 -2
  48. data/spec/{rdkafka → lib/rdkafka}/producer/delivery_report_spec.rb +1 -1
  49. data/spec/{rdkafka → lib/rdkafka}/producer_spec.rb +301 -8
  50. data/spec/spec_helper.rb +65 -16
  51. metadata +87 -43
  52. data/spec/rdkafka/producer/partitions_count_spec.rb +0 -359
  53. /data/spec/{rdkafka → lib/rdkafka}/abstract_handle_spec.rb +0 -0
  54. /data/spec/{rdkafka → lib/rdkafka}/admin/create_acl_handle_spec.rb +0 -0
  55. /data/spec/{rdkafka → lib/rdkafka}/admin/create_acl_report_spec.rb +0 -0
  56. /data/spec/{rdkafka → lib/rdkafka}/admin/create_topic_handle_spec.rb +0 -0
  57. /data/spec/{rdkafka → lib/rdkafka}/admin/create_topic_report_spec.rb +0 -0
  58. /data/spec/{rdkafka → lib/rdkafka}/admin/delete_acl_handle_spec.rb +0 -0
  59. /data/spec/{rdkafka → lib/rdkafka}/admin/delete_acl_report_spec.rb +0 -0
  60. /data/spec/{rdkafka → lib/rdkafka}/admin/delete_topic_handle_spec.rb +0 -0
  61. /data/spec/{rdkafka → lib/rdkafka}/admin/delete_topic_report_spec.rb +0 -0
  62. /data/spec/{rdkafka → lib/rdkafka}/admin/describe_acl_handle_spec.rb +0 -0
  63. /data/spec/{rdkafka → lib/rdkafka}/admin/describe_acl_report_spec.rb +0 -0
  64. /data/spec/{rdkafka → lib/rdkafka}/callbacks_spec.rb +0 -0
  65. /data/spec/{rdkafka → lib/rdkafka}/consumer/headers_spec.rb +0 -0
  66. /data/spec/{rdkafka → lib/rdkafka}/consumer/message_spec.rb +0 -0
  67. /data/spec/{rdkafka → lib/rdkafka}/consumer/partition_spec.rb +0 -0
  68. /data/spec/{rdkafka → lib/rdkafka}/consumer/topic_partition_list_spec.rb +0 -0
  69. /data/spec/{rdkafka → lib/rdkafka}/error_spec.rb +0 -0
  70. /data/spec/{rdkafka → lib/rdkafka}/native_kafka_spec.rb +0 -0
  71. /data/spec/{rdkafka → lib/rdkafka}/producer/delivery_handle_spec.rb +0 -0
  72. /data/spec/{rdkafka → lib/rdkafka}/producer/partitions_count_cache_spec.rb +0 -0
@@ -22,44 +22,8 @@ env:
22
22
  CONFLUENT_VERSION: "8.0.0"
23
23
 
24
24
  jobs:
25
- build_install:
26
- timeout-minutes: 30
27
- runs-on: macos-latest
28
- steps:
29
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30
- with:
31
- fetch-depth: 0
32
- - name: Install Bash 4+ and Kerberos
33
- run: |
34
- brew install bash
35
- brew list krb5 &>/dev/null || brew install krb5
36
- echo "/opt/homebrew/bin" >> $GITHUB_PATH
37
- - name: Set up Ruby
38
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
39
- with:
40
- ruby-version: '3.4' # Use one Ruby version for building
41
- bundler-cache: false
42
- - name: Build gem with mini_portile
43
- run: |
44
- set -e
45
- bundle install
46
- cd ext && bundle exec rake
47
- cd ..
48
- - name: Upload built gem and bundle
49
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
50
- with:
51
- name: rdkafka-built-gem-macos
52
- path: |
53
- vendor/bundle/
54
- .bundle/
55
- ext/
56
- lib/
57
- retention-days: 1
58
-
59
25
  specs_install:
60
- timeout-minutes: 30
61
- runs-on: macos-latest
62
- needs: build_install
26
+ timeout-minutes: 45
63
27
  strategy:
64
28
  fail-fast: false
65
29
  matrix:
@@ -69,25 +33,28 @@ jobs:
69
33
  - '3.3'
70
34
  - '3.2'
71
35
  - '3.1'
36
+ macos-version:
37
+ - 'macos-14' # macOS 14 Sonoma (ARM64)
38
+ - 'macos-15' # macOS 15 Sequoia (ARM64)
72
39
  include:
73
40
  - ruby: '3.4'
41
+ macos-version: 'macos-15'
74
42
  coverage: 'true'
43
+ exclude:
44
+ - ruby: '3.5.0-preview1'
45
+ macos-version: 'macos-14'
46
+ runs-on: ${{ matrix.macos-version }}
75
47
  steps:
76
48
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
77
49
  with:
78
50
  fetch-depth: 0
79
- - name: Download built gem
80
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
81
- with:
82
- name: rdkafka-built-gem-macos
83
- path: ./
84
51
  - name: Install Bash 4+ and Kerberos
85
52
  run: |
86
53
  brew install bash
87
54
  brew list krb5 &>/dev/null || brew install krb5
88
55
  echo "/opt/homebrew/bin" >> $GITHUB_PATH
89
56
  - name: Set up Ruby
90
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
57
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
91
58
  with:
92
59
  ruby-version: ${{matrix.ruby}}
93
60
  bundler-cache: false
@@ -153,12 +120,16 @@ jobs:
153
120
  [ $i -eq 30 ] && { echo "❌ Kafka failed to start"; exit 1; }
154
121
  sleep 2
155
122
  done
156
- - name: Install remaining dependencies
123
+ - name: Install dependencies
157
124
  env:
158
125
  RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
159
126
  run: |
160
- # Only install gems that aren't Ruby-version specific
161
127
  bundle install
128
+ - name: Build gem with mini_portile
129
+ run: |
130
+ set -e
131
+ cd ext && bundle exec rake
132
+ cd ..
162
133
  - name: Run all specs
163
134
  env:
164
135
  GITHUB_COVERAGE: ${{matrix.coverage}}
@@ -168,7 +139,7 @@ jobs:
168
139
 
169
140
  build_precompiled:
170
141
  timeout-minutes: 45
171
- runs-on: macos-latest
142
+ runs-on: macos-14
172
143
  steps:
173
144
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
174
145
  with:
@@ -179,7 +150,7 @@ jobs:
179
150
  brew list krb5 &>/dev/null || brew install krb5
180
151
  echo "/opt/homebrew/bin" >> $GITHUB_PATH
181
152
  - name: Cache build-tmp directory
182
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
153
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
183
154
  with:
184
155
  path: ext/build-tmp-macos
185
156
  key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
@@ -196,7 +167,6 @@ jobs:
196
167
 
197
168
  specs_precompiled:
198
169
  timeout-minutes: 30
199
- runs-on: macos-latest
200
170
  needs: build_precompiled
201
171
  strategy:
202
172
  fail-fast: false
@@ -207,20 +177,28 @@ jobs:
207
177
  - '3.3'
208
178
  - '3.2'
209
179
  - '3.1'
180
+ macos-version:
181
+ - 'macos-14'
182
+ - 'macos-15'
210
183
  include:
211
184
  - ruby: '3.4'
185
+ macos-version: 'macos-15'
212
186
  coverage: 'true'
187
+ exclude:
188
+ - ruby: '3.5.0-preview1'
189
+ macos-version: 'macos-14'
190
+ runs-on: ${{ matrix.macos-version }}
213
191
  steps:
214
192
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
215
193
  with:
216
194
  fetch-depth: 0
217
195
  - name: Download precompiled library
218
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
196
+ uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
219
197
  with:
220
198
  name: librdkafka-precompiled-macos
221
199
  path: ext/
222
200
  - name: Set up Ruby
223
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
201
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
224
202
  with:
225
203
  ruby-version: ${{ matrix.ruby }}
226
204
  bundler-cache: false
@@ -0,0 +1,65 @@
1
+ name: Push Linux aarch64 GNU Platform Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ env:
12
+ BUNDLE_RETRY: 6
13
+ BUNDLE_JOBS: 4
14
+
15
+ jobs:
16
+ push:
17
+ if: github.repository_owner == 'karafka'
18
+ timeout-minutes: 30
19
+ # Same as CI, we build on the oldest possible for ABI compatibility
20
+ runs-on: ubuntu-22.04-arm # renovate: ignore
21
+ environment: deployment
22
+ permissions:
23
+ contents: write
24
+ id-token: write
25
+ steps:
26
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27
+ with:
28
+ fetch-depth: 0
29
+ - name: Install build dependencies
30
+ run: |
31
+ sudo apt-get update
32
+ sudo apt-get install -y --no-install-recommends \
33
+ build-essential \
34
+ gcc \
35
+ make \
36
+ patch \
37
+ tar \
38
+ wget \
39
+ ca-certificates \
40
+ libsasl2-dev \
41
+ libssl-dev \
42
+ zlib1g-dev \
43
+ libzstd-dev
44
+ - name: Cache build-tmp directory
45
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
46
+ with:
47
+ path: ext/build-tmp
48
+ key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh') }}
49
+ - name: Set up Ruby
50
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
51
+ with:
52
+ ruby-version: '3.4'
53
+ bundler-cache: false
54
+ - name: Build precompiled librdkafka.so
55
+ run: |
56
+ cd ext
57
+ ./build_linux_aarch64_gnu.sh
58
+ - name: Configure trusted publishing credentials
59
+ uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
60
+ - name: Build and push platform-specific gem
61
+ run: |
62
+ gem build *.gemspec
63
+ gem push *.gem
64
+ env:
65
+ RUBY_PLATFORM: 'aarch64-linux-gnu'
@@ -16,7 +16,8 @@ jobs:
16
16
  push:
17
17
  if: github.repository_owner == 'karafka'
18
18
  timeout-minutes: 30
19
- runs-on: ubuntu-latest
19
+ # Same as CI, we build on the oldest possible for ABI compatibility
20
+ runs-on: ubuntu-22.04 # renovate: ignore
20
21
  environment: deployment
21
22
  permissions:
22
23
  contents: write
@@ -41,12 +42,12 @@ jobs:
41
42
  zlib1g-dev \
42
43
  libzstd-dev
43
44
  - name: Cache build-tmp directory
44
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
45
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
45
46
  with:
46
47
  path: ext/build-tmp
47
48
  key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh') }}
48
49
  - name: Set up Ruby
49
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
50
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
50
51
  with:
51
52
  ruby-version: '3.4'
52
53
  bundler-cache: false
@@ -15,7 +15,8 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  environment: deployment
17
17
  container:
18
- image: alpine:3.22@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be023728e11715
18
+ # Same as CI, we build on the oldest possible for ABI compatibility
19
+ image: alpine:3.18@sha256:de0eb0b3f2a47ba1eb89389859a9bd88b28e82f5826b6969ad604979713c2d4f # renovate: ignore
19
20
  steps:
20
21
  - name: Install dependencies
21
22
  run: |
@@ -30,7 +31,7 @@ jobs:
30
31
  - name: Configure git safe directory
31
32
  run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
32
33
  - name: Cache build-tmp directory
33
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
34
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
34
35
  with:
35
36
  path: ext/build-tmp-musl
36
37
  key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
@@ -44,6 +45,7 @@ jobs:
44
45
  name: librdkafka-precompiled-musl
45
46
  path: ext/
46
47
  retention-days: 1
48
+
47
49
  push:
48
50
  if: github.repository_owner == 'karafka'
49
51
  timeout-minutes: 30
@@ -58,12 +60,12 @@ jobs:
58
60
  with:
59
61
  fetch-depth: 0
60
62
  - name: Download precompiled library
61
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
63
+ uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
62
64
  with:
63
65
  name: librdkafka-precompiled-musl
64
66
  path: ext/
65
67
  - name: Set up Ruby
66
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
68
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
67
69
  with:
68
70
  ruby-version: '3.4'
69
71
  bundler-cache: false
@@ -16,7 +16,7 @@ jobs:
16
16
  push:
17
17
  if: github.repository_owner == 'karafka'
18
18
  timeout-minutes: 30
19
- runs-on: macos-latest
19
+ runs-on: macos-14
20
20
  environment: deployment
21
21
  permissions:
22
22
  contents: write
@@ -31,12 +31,12 @@ jobs:
31
31
  brew list krb5 &>/dev/null || brew install krb5
32
32
  echo "/opt/homebrew/bin" >> $GITHUB_PATH
33
33
  - name: Cache build-tmp directory
34
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
34
+ uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
35
35
  with:
36
36
  path: ext/build-tmp-macos
37
37
  key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
38
38
  - name: Set up Ruby
39
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
39
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
40
40
  with:
41
41
  ruby-version: '3.4'
42
42
  bundler-cache: false
@@ -24,7 +24,7 @@ jobs:
24
24
  fetch-depth: 0
25
25
 
26
26
  - name: Set up Ruby
27
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
27
+ uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
28
28
  with:
29
29
  bundler-cache: false
30
30
 
@@ -0,0 +1,30 @@
1
+ name: Trigger Wiki Refresh
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ push:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ trigger-wiki-refresh:
11
+ runs-on: ubuntu-latest
12
+ environment: wiki-trigger
13
+ if: github.repository_owner == 'karafka'
14
+ steps:
15
+ - name: Trigger wiki refresh
16
+ uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
17
+ with:
18
+ token: ${{ secrets.WIKI_REPO_TOKEN }}
19
+ repository: karafka/wiki
20
+ event-type: sync-trigger
21
+ client-payload: |
22
+ {
23
+ "repository": "${{ github.repository }}",
24
+ "event_name": "${{ github.event_name }}",
25
+ "release_tag": "${{ github.event.release.tag_name || '' }}",
26
+ "release_name": "${{ github.event.release.name || '' }}",
27
+ "commit_sha": "${{ github.sha }}",
28
+ "commit_message": "Trigger Wiki Refresh",
29
+ "triggered_by": "${{ github.actor }}"
30
+ }
@@ -4,7 +4,7 @@ on:
4
4
  paths:
5
5
  - '.github/workflows/**'
6
6
  jobs:
7
- verify:
7
+ verify_action_pins:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
10
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
data/.gitignore CHANGED
@@ -13,3 +13,4 @@ coverage
13
13
  vendor
14
14
  .idea/
15
15
  out/
16
+ ssl/
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --require spec_helper
2
2
  --format documentation
3
+ --pattern spec/lib/**/*_spec.rb
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.4
1
+ 3.4.5
data/CHANGELOG.md CHANGED
@@ -1,13 +1,29 @@
1
1
  # Rdkafka Changelog
2
2
 
3
- ## 0.20.0 (Unreleased)
3
+ ## 0.21.0 (2025-08-18)
4
+ - [Enhancement] Support explicit Debian testing due to lib issues.
5
+ - [Enhancement] Support ARM64 Gnu precompilation.
6
+ - [Enhancement] Bump librdkafka to 2.11.0.
7
+ - [Enhancement] Improve what symbols are exposed outside of the precompiled extensions.
8
+ - [Enhancement] Introduce an integration suite layer for non RSpec specs execution.
9
+ - [Fix] Add `json` gem as a dependency (was missing but used).
10
+
11
+ ## 0.20.1 (2025-07-17)
12
+ - [Enhancement] Drastically increase number of platforms in the integration suite
13
+ - [Fix] Support Ubuntu `22.04` and older Alpine precompiled versions
14
+ - [Fix] FFI::DynamicLibrary.load_library': Could not open library
15
+ - [Change] Add new CI action to trigger auto-doc refresh.
16
+
17
+ ## 0.20.0 (2025-07-17)
4
18
  - **[Feature]** Add precompiled `x86_64-linux-gnu` setup.
5
19
  - **[Feature]** Add precompiled `x86_64-linux-musl` setup.
6
20
  - **[Feature]** Add precompiled `macos_arm64` setup.
7
21
  - [Enhancement] Run all specs on each of the platforms with and without precompilation.
22
+ - [Enhancement] Support transactional id in the ACL API.
8
23
  - [Fix] Fix a case where using empty key on the `musl` architecture would cause a segfault.
24
+ - [Fix] Fix for null pointer reference bypass on empty string being too wide causing segfault.
9
25
 
10
- **Note**: Precompiled extensions are a new feature in this release. While they significantly improve installation speed and reduce build dependencies, they should be thoroughly tested in your staging environment before deploying to production. If you encounter any issues with precompiled extensions, you can fall back to building from sources.
26
+ **Note**: Precompiled extensions are a new feature in this release. While they significantly improve installation speed and reduce build dependencies, they should be thoroughly tested in your staging environment before deploying to production. If you encounter any issues with precompiled extensions, you can fall back to building from sources. For more information, see the [Native Extensions documentation](https://karafka.io/docs/Development-Native-Extensions/).
11
27
 
12
28
  ## 0.19.5 (2025-05-30)
13
29
  - [Enhancement] Allow for producing to non-existing topics with `key` and `partition_key` present.
data/README.md CHANGED
@@ -1,177 +1,78 @@
1
- # Rdkafka
1
+ # Karafka-Rdkafka
2
2
 
3
- [![Build Status](https://github.com/karafka/rdkafka-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/karafka/rdkafka-ruby/actions/workflows/ci.yml)
4
- [![Gem Version](https://badge.fury.io/rb/rdkafka.svg)](https://badge.fury.io/rb/rdkafka)
3
+ [![Build Status](https://github.com/karafka/karafka-rdkafka/actions/workflows/ci_linux_ubuntu_x86_64_gnu.yml/badge.svg)](https://github.com/karafka/karafka-rdkafka/actions/workflows/ci_linux_x86_64_gnu.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/karafka-rdkafka.svg)](https://badge.fury.io/rb/karafka-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
 
7
7
  > [!NOTE]
8
- > The `rdkafka-ruby` gem was created and developed by [AppSignal](https://www.appsignal.com/). Their impactful contributions have significantly shaped the Ruby Kafka and Karafka ecosystems. For robust monitoring, we highly recommend AppSignal.
8
+ > **Karafka-Rdkafka** is a fork of the [rdkafka-ruby](https://github.com/karafka/rdkafka-ruby) gem, specifically maintained for the [Karafka ecosystem](https://karafka.io). This fork exists to provide Karafka-specific patches and optimizations that are not generic enough for inclusion in the upstream rdkafka-ruby library.
9
9
 
10
10
  ---
11
11
 
12
- The `rdkafka` gem is a modern Kafka client library for Ruby based on
13
- [librdkafka](https://github.com/confluentinc/librdkafka/).
14
- It wraps the production-ready C client using the [ffi](https://github.com/ffi/ffi)
15
- gem and targets Kafka 1.0+ and Ruby versions under security or
16
- active maintenance. We remove a Ruby version from our CI builds when they
17
- become EOL.
12
+ ## Why This Fork Exists
18
13
 
19
- `rdkafka` was written because of the need for a reliable Ruby client for Kafka that supports modern Kafka at [AppSignal](https://appsignal.com). AppSignal runs it in production on very high-traffic systems.
14
+ While rdkafka-ruby serves as an excellent general-purpose Kafka client for Ruby, Karafka requires specific optimizations and patches that are:
20
15
 
21
- The most essential pieces of a Kafka client are implemented, and we aim to provide all relevant consumer, producer, and admin APIs.
16
+ - **Karafka-specific**: Tailored for Karafka's unique processing patterns and requirements
17
+ - **Performance-oriented**: Focused on high-throughput, low-latency scenarios that Karafka specializes in
18
+ - **Framework-integrated**: Designed to work seamlessly with Karafka's architecture and features
22
19
 
23
- ## Table of content
20
+ These modifications are not suitable for the upstream rdkafka-ruby library because they are either too specific to Karafka's use cases or might introduce breaking changes for other users of rdkafka-ruby.
24
21
 
25
- - [Project Scope](#project-scope)
26
- - [Installation](#installation)
27
- - [Usage](#usage)
28
- * [Consuming Messages](#consuming-messages)
29
- * [Producing Messages](#producing-messages)
30
- - [Higher Level Libraries](#higher-level-libraries)
31
- * [Message Processing Frameworks](#message-processing-frameworks)
32
- * [Message Publishing Libraries](#message-publishing-libraries)
33
- - [Forking](#forking)
34
- - [Development](#development)
35
- - [Example](#example)
36
- - [Versions](#versions)
22
+ ## Maintenance and Synchronization
37
23
 
38
- ## Project Scope
24
+ This fork is actively maintained and kept in sync with the upstream rdkafka-ruby repository as much as possible. We:
39
25
 
40
- While rdkafka-ruby aims to simplify the use of librdkafka in Ruby applications, it's important to understand the limitations of this library:
26
+ - **Regularly merge** upstream changes from rdkafka-ruby
27
+ - **Maintain compatibility** with the rdkafka-ruby API wherever possible
28
+ - **Apply minimal patches** to avoid diverging significantly from upstream
29
+ - **Merge back generic improvements** from karafka-rdkafka to rdkafka-ruby when they benefit the broader community
30
+ - **Test thoroughly** to ensure stability within the Karafka ecosystem
41
31
 
42
- - **No Complex Producers/Consumers**: This library does not intend to offer complex producers or consumers. The aim is to stick closely to the functionalities provided by librdkafka itself.
32
+ ## Long-term Plan
43
33
 
44
- - **Focus on librdkafka Capabilities**: Features that can be achieved directly in Ruby, without specific needs from librdkafka, are outside the scope of this library.
34
+ Our long-term goal is to work with the rdkafka-ruby maintainers to eventually merge the beneficial changes back upstream. This would allow us to:
45
35
 
46
- - **Existing High-Level Functionalities**: Certain high-level functionalities like producer metadata cache and simple consumer are already part of the library. Although they fall slightly outside the primary goal, they will remain part of the contract, given their existing usage.
36
+ - Reduce maintenance overhead
37
+ - Benefit the broader Ruby Kafka community
38
+ - Simplify the Karafka ecosystem dependencies
47
39
 
40
+ However, until such integration is possible, this fork ensures that Karafka users get the best possible performance and reliability.
48
41
 
49
- ## Installation
42
+ ### If You're Using Standalone rdkafka
50
43
 
51
- When installed, this gem downloads and compiles librdkafka. If you have any problems installing the gem, please open an issue.
44
+ You should use the [original rdkafka-ruby gem](https://github.com/karafka/rdkafka-ruby) for general Kafka client needs. This fork is specifically designed for Karafka and may not be suitable for other use cases.
52
45
 
53
- ## Usage
46
+ ### Reporting Issues
54
47
 
55
- Please see the [documentation](https://karafka.io/docs/code/rdkafka-ruby/) for full details on how to use this gem. Below are two quick examples.
48
+ For issues related to this fork, please report them in the [rdkafka-ruby repository](https://github.com/karafka/rdkafka-ruby/issues) rather than here. This helps us:
56
49
 
57
- Unless you are seeking specific low-level capabilities, we **strongly** recommend using [Karafka](https://github.com/karafka/karafka) and [WaterDrop](https://github.com/karafka/waterdrop) when working with Kafka. These are higher-level libraries also maintained by us based on rdkafka-ruby.
50
+ - Maintain a single place for issue tracking
51
+ - Ensure upstream compatibility
52
+ - Provide better support for all users
58
53
 
59
- ### Consuming Messages
54
+ ### Contributing
60
55
 
61
- Subscribe to a topic and get messages. Kafka will automatically spread
62
- the available partitions over consumers with the same group id.
56
+ Contributions should generally be made to the upstream [rdkafka-ruby repository](https://github.com/karafka/rdkafka-ruby). Changes to this fork are only made when:
63
57
 
64
- ```ruby
65
- config = {
66
- :"bootstrap.servers" => "localhost:9092",
67
- :"group.id" => "ruby-test"
68
- }
69
- consumer = Rdkafka::Config.new(config).consumer
70
- consumer.subscribe("ruby-test-topic")
71
-
72
- consumer.each do |message|
73
- puts "Message received: #{message}"
74
- end
75
- ```
76
-
77
- ### Producing Messages
78
-
79
- Produce several messages, put the delivery handles in an array, and
80
- wait for them before exiting. This way the messages will be batched and
81
- efficiently sent to Kafka.
82
-
83
- ```ruby
84
- config = {:"bootstrap.servers" => "localhost:9092"}
85
- producer = Rdkafka::Config.new(config).producer
86
- delivery_handles = []
87
-
88
- 100.times do |i|
89
- puts "Producing message #{i}"
90
- delivery_handles << producer.produce(
91
- topic: "ruby-test-topic",
92
- payload: "Payload #{i}",
93
- key: "Key #{i}"
94
- )
95
- end
96
-
97
- delivery_handles.each(&:wait)
98
- ```
99
-
100
- Note that creating a producer consumes some resources that will not be released until it `#close` is explicitly called, so be sure to call `Config#producer` only as necessary.
101
-
102
- ## Higher Level Libraries
103
-
104
- Currently, there are two actively developed frameworks based on `rdkafka-ruby`, that provide higher-level API that can be used to work with Kafka messages and one library for publishing messages.
105
-
106
- ### Message Processing Frameworks
107
-
108
- * [Karafka](https://github.com/karafka/karafka) - Ruby and Rails efficient Kafka processing framework.
109
- * [Racecar](https://github.com/zendesk/racecar) - A simple framework for Kafka consumers in Ruby
110
-
111
- ### Message Publishing Libraries
112
-
113
- * [WaterDrop](https://github.com/karafka/waterdrop) – Standalone Karafka library for producing Kafka messages.
114
-
115
- ## Forking
116
-
117
- When working with `rdkafka-ruby`, it's essential to know that the underlying `librdkafka` library does not support fork-safe operations, even though it is thread-safe. Forking a process after initializing librdkafka clients can lead to unpredictable behavior due to inherited file descriptors and memory states. This limitation requires careful handling, especially in Ruby applications that rely on forking.
118
-
119
- To address this, it's highly recommended to:
120
-
121
- - Never initialize any `rdkafka-ruby` producers or consumers before forking to avoid state corruption.
122
- - Before forking, always close any open producers or consumers if you've opened any.
123
- - Use high-level libraries like [WaterDrop](https://github.com/karafka/waterdrop) and [Karafka](https://github.com/karafka/karafka/), which provide abstractions for handling librdkafka's intricacies.
124
-
125
- ## Development
126
-
127
- Contributors are encouraged to focus on enhancements that align with the core goal of the library. We appreciate contributions but will likely not accept pull requests for features that:
128
-
129
- - Implement functionalities that can achieved using standard Ruby capabilities without changes to the underlying rdkafka-ruby bindings.
130
- - Deviate significantly from the primary aim of providing librdkafka bindings with Ruby-friendly interfaces.
131
-
132
- A Docker Compose file is included to run Kafka. To run that:
133
-
134
- ```
135
- docker-compose up
136
- ```
137
-
138
- Run `bundle` and `cd ext && bundle exec rake && cd ..` to download and compile `librdkafka`.
139
-
140
- You can then run `bundle exec rspec` to run the tests. To see rdkafka debug output:
141
-
142
- ```
143
- DEBUG_PRODUCER=true bundle exec rspec
144
- DEBUG_CONSUMER=true bundle exec rspec
145
- ```
146
-
147
- After running the tests, you can bring the cluster down to start with a clean slate:
148
-
149
- ```
150
- docker-compose down
151
- ```
152
-
153
- ## Example
154
-
155
- To see everything working, run these in separate tabs:
156
-
157
- ```
158
- bundle exec rake consume_messages
159
- bundle exec rake produce_messages
160
- ```
58
+ - They are specific to Karafka's requirements
59
+ - They cannot be generalized for upstream inclusion
60
+ - They are temporary while working on upstream integration
161
61
 
162
62
  ## Versions
163
63
 
164
64
  | rdkafka-ruby | librdkafka | patches |
165
65
  |-|-|-|
166
- | 0.20.x (Unreleased) | 2.8.0 (2025-01-07) | yes |
167
- | 0.19.x (2025-01-20) | 2.8.0 (2025-01-07) | yes |
168
- | 0.18.0 (2024-11-26) | 2.6.1 (2024-11-18) | yes |
169
- | 0.17.4 (2024-09-02) | 2.5.3 (2024-09-02) | yes |
170
- | 0.17.0 (2024-08-01) | 2.5.0 (2024-07-10) | yes |
171
- | 0.16.0 (2024-06-13) | 2.4.0 (2024-05-07) | no |
172
- | 0.15.0 (2023-12-03) | 2.3.0 (2023-10-25) | no |
173
- | 0.14.0 (2023-11-21) | 2.2.0 (2023-07-12) | no |
174
- | 0.13.0 (2023-07-24) | 2.0.2 (2023-01-20) | no |
175
- | 0.12.0 (2022-06-17) | 1.9.0 (2022-06-16) | no |
176
- | 0.11.0 (2021-11-17) | 1.8.2 (2021-10-18) | no |
177
- | 0.10.0 (2021-09-07) | 1.5.0 (2020-07-20) | no |
66
+ | 0.21.x (2025-08-18) | 2.11.0 (2025-07-03) | yes |
67
+ | 0.20.x (2025-07-17) | 2.8.0 (2025-01-07) | yes |
68
+ | 0.19.x (2025-01-20) | 2.8.0 (2025-01-07) | yes |
69
+ | 0.18.0 (2024-11-26) | 2.6.1 (2024-11-18) | yes |
70
+ | 0.17.4 (2024-09-02) | 2.5.3 (2024-09-02) | yes |
71
+ | 0.17.0 (2024-08-01) | 2.5.0 (2024-07-10) | yes |
72
+ | 0.16.0 (2024-06-13) | 2.4.0 (2024-05-07) | no |
73
+ | 0.15.0 (2023-12-03) | 2.3.0 (2023-10-25) | no |
74
+ | 0.14.0 (2023-11-21) | 2.2.0 (2023-07-12) | no |
75
+ | 0.13.0 (2023-07-24) | 2.0.2 (2023-01-20) | no |
76
+ | 0.12.0 (2022-06-17) | 1.9.0 (2022-06-16) | no |
77
+ | 0.11.0 (2021-11-17) | 1.8.2 (2021-10-18) | no |
78
+ | 0.10.0 (2021-09-07) | 1.5.0 (2020-07-20) | no |
Binary file
Binary file
Binary file
Binary file
Binary file