rdkafka 0.21.0 → 0.22.2

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +3 -0
  3. data/.github/workflows/ci_linux_x86_64_gnu.yml +271 -0
  4. data/.github/workflows/ci_linux_x86_64_musl.yml +194 -0
  5. data/.github/workflows/ci_macos_arm64.yml +284 -0
  6. data/.github/workflows/push_linux_x86_64_gnu.yml +65 -0
  7. data/.github/workflows/push_linux_x86_64_musl.yml +79 -0
  8. data/.github/workflows/push_macos_arm64.yml +54 -0
  9. data/.github/workflows/push_ruby.yml +37 -0
  10. data/.github/workflows/verify-action-pins.yml +16 -0
  11. data/.ruby-version +1 -1
  12. data/CHANGELOG.md +27 -0
  13. data/README.md +3 -2
  14. data/Rakefile +0 -2
  15. data/docker-compose.yml +1 -1
  16. data/ext/Rakefile +1 -1
  17. data/ext/build_common.sh +361 -0
  18. data/ext/build_linux_x86_64_gnu.sh +306 -0
  19. data/ext/build_linux_x86_64_musl.sh +763 -0
  20. data/ext/build_macos_arm64.sh +550 -0
  21. data/lib/rdkafka/bindings.rb +31 -5
  22. data/lib/rdkafka/config.rb +8 -4
  23. data/lib/rdkafka/consumer/headers.rb +14 -3
  24. data/lib/rdkafka/native_kafka.rb +8 -2
  25. data/lib/rdkafka/producer/partitions_count_cache.rb +216 -0
  26. data/lib/rdkafka/producer.rb +70 -41
  27. data/lib/rdkafka/version.rb +1 -1
  28. data/lib/rdkafka.rb +1 -0
  29. data/rdkafka.gemspec +27 -10
  30. data/renovate.json +87 -1
  31. data/spec/rdkafka/admin_spec.rb +229 -12
  32. data/spec/rdkafka/bindings_spec.rb +0 -33
  33. data/spec/rdkafka/config_spec.rb +17 -15
  34. data/spec/rdkafka/consumer/headers_spec.rb +26 -10
  35. data/spec/rdkafka/consumer_spec.rb +74 -15
  36. data/spec/rdkafka/metadata_spec.rb +2 -2
  37. data/spec/rdkafka/producer/partitions_count_cache_spec.rb +359 -0
  38. data/spec/rdkafka/producer_spec.rb +531 -8
  39. data/spec/spec_helper.rb +30 -7
  40. metadata +45 -87
  41. checksums.yaml.gz.sig +0 -0
  42. data/.github/workflows/ci.yml +0 -83
  43. data/Guardfile +0 -19
  44. data/certs/cert.pem +0 -26
  45. data.tar.gz.sig +0 -0
  46. metadata.gz.sig +0 -0
@@ -0,0 +1,284 @@
1
+ name: CI macOS ARM64
2
+
3
+ concurrency:
4
+ group: ${{ github.workflow }}-${{ github.ref }}
5
+ cancel-in-progress: true
6
+
7
+ on:
8
+ pull_request:
9
+ branches: [ main, master ]
10
+ push:
11
+ branches: [ main, master ]
12
+ schedule:
13
+ - cron: '0 1 * * *'
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ env:
19
+ BUNDLE_RETRY: 6
20
+ BUNDLE_JOBS: 4
21
+ # Renovate can track and update this version
22
+ CONFLUENT_VERSION: "8.0.0"
23
+
24
+ jobs:
25
+ specs_install:
26
+ timeout-minutes: 30
27
+ strategy:
28
+ fail-fast: false
29
+ matrix:
30
+ ruby:
31
+ - '3.5.0-preview1'
32
+ - '3.4'
33
+ - '3.3'
34
+ - '3.2'
35
+ - '3.1'
36
+ macos-version:
37
+ - 'macos-14' # macOS 14 Sonoma (ARM64)
38
+ - 'macos-15' # macOS 15 Sequoia (ARM64)
39
+ include:
40
+ - ruby: '3.4'
41
+ macos-version: 'macos-15'
42
+ coverage: 'true'
43
+ exclude:
44
+ - ruby: '3.5.0-preview1'
45
+ macos-version: 'macos-14'
46
+ runs-on: ${{ matrix.macos-version }}
47
+ steps:
48
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
49
+ with:
50
+ fetch-depth: 0
51
+ - name: Install Bash 4+ and Kerberos
52
+ run: |
53
+ brew install bash
54
+ brew list krb5 &>/dev/null || brew install krb5
55
+ echo "/opt/homebrew/bin" >> $GITHUB_PATH
56
+ - name: Set up Ruby
57
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
58
+ with:
59
+ ruby-version: ${{matrix.ruby}}
60
+ bundler-cache: false
61
+ - name: Install and Start Confluent Community Kafka (KRaft)
62
+ run: |
63
+ brew install openjdk@17
64
+ export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
65
+ export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
66
+
67
+ curl -O "https://packages.confluent.io/archive/8.0/confluent-community-${CONFLUENT_VERSION}.tar.gz"
68
+ tar -xzf "confluent-community-${CONFLUENT_VERSION}.tar.gz"
69
+
70
+ export CONFLUENT_HOME="$(pwd)/confluent-${CONFLUENT_VERSION}"
71
+ export PATH="$CONFLUENT_HOME/bin:$PATH"
72
+ cd "$CONFLUENT_HOME"
73
+
74
+ # Find the correct server config
75
+ KRAFT_CONFIG=""
76
+ for config in "etc/kafka/kraft/server.properties" "config/kraft/server.properties" "etc/kafka/server.properties"; do
77
+ if [ -f "$config" ]; then
78
+ KRAFT_CONFIG="$config"
79
+ echo "Found config: $KRAFT_CONFIG"
80
+ break
81
+ fi
82
+ done
83
+
84
+ if [ -z "$KRAFT_CONFIG" ]; then
85
+ echo "❌ No server config found"
86
+ exit 1
87
+ fi
88
+
89
+ # Configure KRaft for single-node setup
90
+ cat >> "$KRAFT_CONFIG" << 'EOF'
91
+
92
+ # KRaft mode configuration for single-node setup
93
+ process.roles=broker,controller
94
+ node.id=1
95
+ controller.quorum.voters=1@127.0.0.1:9093
96
+ listeners=PLAINTEXT://127.0.0.1:9092,CONTROLLER://127.0.0.1:9093
97
+ controller.listener.names=CONTROLLER
98
+ inter.broker.listener.name=PLAINTEXT
99
+ log.dirs=/tmp/kraft-combined-logs
100
+
101
+ # Enable simple ACL authorization for testing
102
+ authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer
103
+ super.users=User:ANONYMOUS
104
+ allow.everyone.if.no.acl.found=true
105
+ EOF
106
+
107
+ echo "Updated KRaft configuration"
108
+
109
+ CLUSTER_ID=$(bin/kafka-storage random-uuid)
110
+ bin/kafka-storage format -t "$CLUSTER_ID" -c "$KRAFT_CONFIG"
111
+ bin/kafka-server-start "$KRAFT_CONFIG" &
112
+
113
+ sleep 20
114
+
115
+ for i in {1..30}; do
116
+ if bin/kafka-topics --bootstrap-server 127.0.0.1:9092 --list >/dev/null 2>&1; then
117
+ echo "✅ Confluent Community ${CONFLUENT_VERSION} (KRaft) is ready!"
118
+ break
119
+ fi
120
+ [ $i -eq 30 ] && { echo "❌ Kafka failed to start"; exit 1; }
121
+ sleep 2
122
+ done
123
+ - name: Install dependencies
124
+ env:
125
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
126
+ run: |
127
+ bundle install
128
+ - name: Build gem with mini_portile
129
+ run: |
130
+ set -e
131
+ cd ext && bundle exec rake
132
+ cd ..
133
+ - name: Run all specs
134
+ env:
135
+ GITHUB_COVERAGE: ${{matrix.coverage}}
136
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
137
+ run: |
138
+ bundle exec rspec
139
+
140
+ build_precompiled:
141
+ timeout-minutes: 45
142
+ runs-on: macos-14
143
+ steps:
144
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
145
+ with:
146
+ fetch-depth: 0
147
+ - name: Install Bash 4+ and Kerberos
148
+ run: |
149
+ brew install bash
150
+ brew list krb5 &>/dev/null || brew install krb5
151
+ echo "/opt/homebrew/bin" >> $GITHUB_PATH
152
+ - name: Cache build-tmp directory
153
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
154
+ with:
155
+ path: ext/build-tmp-macos
156
+ key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
157
+ - name: Build precompiled librdkafka for macOS ARM64
158
+ run: |
159
+ cd ext
160
+ /opt/homebrew/bin/bash ./build_macos_arm64.sh
161
+ - name: Upload precompiled library
162
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
163
+ with:
164
+ name: librdkafka-precompiled-macos
165
+ path: ext/
166
+ retention-days: 1
167
+
168
+ specs_precompiled:
169
+ timeout-minutes: 30
170
+ needs: build_precompiled
171
+ strategy:
172
+ fail-fast: false
173
+ matrix:
174
+ ruby:
175
+ - '3.5.0-preview1'
176
+ - '3.4'
177
+ - '3.3'
178
+ - '3.2'
179
+ - '3.1'
180
+ macos-version:
181
+ - 'macos-14'
182
+ - 'macos-15'
183
+ include:
184
+ - ruby: '3.4'
185
+ macos-version: 'macos-15'
186
+ coverage: 'true'
187
+ exclude:
188
+ - ruby: '3.5.0-preview1'
189
+ macos-version: 'macos-14'
190
+ runs-on: ${{ matrix.macos-version }}
191
+ steps:
192
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
193
+ with:
194
+ fetch-depth: 0
195
+ - name: Download precompiled library
196
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
197
+ with:
198
+ name: librdkafka-precompiled-macos
199
+ path: ext/
200
+ - name: Set up Ruby
201
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
202
+ with:
203
+ ruby-version: ${{ matrix.ruby }}
204
+ bundler-cache: false
205
+ - name: Install Bash 4+ and Kerberos
206
+ run: |
207
+ brew install bash
208
+ brew list krb5 &>/dev/null || brew install krb5
209
+ echo "/opt/homebrew/bin" >> $GITHUB_PATH
210
+ - name: Install and Start Confluent Community Kafka (KRaft)
211
+ run: |
212
+ brew install openjdk@17
213
+ export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
214
+ export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
215
+
216
+ curl -O "https://packages.confluent.io/archive/8.0/confluent-community-${CONFLUENT_VERSION}.tar.gz"
217
+ tar -xzf "confluent-community-${CONFLUENT_VERSION}.tar.gz"
218
+
219
+ export CONFLUENT_HOME="$(pwd)/confluent-${CONFLUENT_VERSION}"
220
+ export PATH="$CONFLUENT_HOME/bin:$PATH"
221
+ cd "$CONFLUENT_HOME"
222
+
223
+ # Find the correct server config
224
+ KRAFT_CONFIG=""
225
+ for config in "etc/kafka/kraft/server.properties" "config/kraft/server.properties" "etc/kafka/server.properties"; do
226
+ if [ -f "$config" ]; then
227
+ KRAFT_CONFIG="$config"
228
+ echo "Found config: $KRAFT_CONFIG"
229
+ break
230
+ fi
231
+ done
232
+
233
+ if [ -z "$KRAFT_CONFIG" ]; then
234
+ echo "❌ No server config found"
235
+ exit 1
236
+ fi
237
+
238
+ # Configure KRaft for single-node setup
239
+ cat >> "$KRAFT_CONFIG" << 'EOF'
240
+
241
+ # KRaft mode configuration for single-node setup
242
+ process.roles=broker,controller
243
+ node.id=1
244
+ controller.quorum.voters=1@127.0.0.1:9093
245
+ listeners=PLAINTEXT://127.0.0.1:9092,CONTROLLER://127.0.0.1:9093
246
+ controller.listener.names=CONTROLLER
247
+ inter.broker.listener.name=PLAINTEXT
248
+ log.dirs=/tmp/kraft-combined-logs
249
+
250
+ # Enable simple ACL authorization for testing
251
+ authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer
252
+ super.users=User:ANONYMOUS
253
+ allow.everyone.if.no.acl.found=true
254
+ EOF
255
+
256
+ echo "Updated KRaft configuration"
257
+
258
+ CLUSTER_ID=$(bin/kafka-storage random-uuid)
259
+ bin/kafka-storage format -t "$CLUSTER_ID" -c "$KRAFT_CONFIG"
260
+ bin/kafka-server-start "$KRAFT_CONFIG" &
261
+
262
+ sleep 20
263
+
264
+ for i in {1..30}; do
265
+ if bin/kafka-topics --bootstrap-server 127.0.0.1:9092 --list >/dev/null 2>&1; then
266
+ echo "✅ Confluent Community ${CONFLUENT_VERSION} (KRaft) is ready!"
267
+ break
268
+ fi
269
+ [ $i -eq 30 ] && { echo "❌ Kafka failed to start"; exit 1; }
270
+ sleep 2
271
+ done
272
+ - name: Install bundle with precompiled library
273
+ env:
274
+ GITHUB_COVERAGE: ${{ matrix.coverage }}
275
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
276
+ run: |
277
+ bundle install
278
+ echo "Bundle install completed with precompiled library"
279
+ - name: Run specs with precompiled library
280
+ env:
281
+ GITHUB_COVERAGE: ${{ matrix.coverage }}
282
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
283
+ run: |
284
+ bundle exec rspec
@@ -0,0 +1,65 @@
1
+ name: Push Linux x86_64 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 # 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@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
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@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.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_x86_64_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: 'x86_64-linux-gnu'
@@ -0,0 +1,79 @@
1
+ name: Push Linux x86_64 musl Platform Gem
2
+ on:
3
+ push:
4
+ tags:
5
+ - v*
6
+ permissions:
7
+ contents: read
8
+ env:
9
+ BUNDLE_RETRY: 6
10
+ BUNDLE_JOBS: 4
11
+ jobs:
12
+ build:
13
+ if: github.repository_owner == 'karafka'
14
+ timeout-minutes: 30
15
+ runs-on: ubuntu-latest
16
+ environment: deployment
17
+ container:
18
+ # Same as CI, we build on the oldest possible for ABI compatibility
19
+ image: alpine:3.18@sha256:de0eb0b3f2a47ba1eb89389859a9bd88b28e82f5826b6969ad604979713c2d4f # renovate: ignore
20
+ steps:
21
+ - name: Install dependencies
22
+ run: |
23
+ apk add --no-cache git curl ca-certificates build-base linux-headers \
24
+ pkgconf perl autoconf automake libtool bison flex file bash wget zstd-dev \
25
+ openssl-dev cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
26
+ cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
27
+ krb5-libs openssl zlib zlib-dev zstd-libs
28
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29
+ with:
30
+ fetch-depth: 0
31
+ - name: Configure git safe directory
32
+ run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
33
+ - name: Cache build-tmp directory
34
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
35
+ with:
36
+ path: ext/build-tmp-musl
37
+ key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
38
+ - name: Build precompiled librdkafka.so
39
+ run: |
40
+ cd ext
41
+ bash ./build_linux_x86_64_musl.sh
42
+ - name: Upload precompiled library
43
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
44
+ with:
45
+ name: librdkafka-precompiled-musl
46
+ path: ext/
47
+ retention-days: 1
48
+
49
+ push:
50
+ if: github.repository_owner == 'karafka'
51
+ timeout-minutes: 30
52
+ runs-on: ubuntu-latest
53
+ needs: build
54
+ environment: deployment
55
+ permissions:
56
+ contents: write
57
+ id-token: write
58
+ steps:
59
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60
+ with:
61
+ fetch-depth: 0
62
+ - name: Download precompiled library
63
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
64
+ with:
65
+ name: librdkafka-precompiled-musl
66
+ path: ext/
67
+ - name: Set up Ruby
68
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
69
+ with:
70
+ ruby-version: '3.4'
71
+ bundler-cache: false
72
+ - name: Configure trusted publishing credentials
73
+ uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
74
+ - name: Build and push platform-specific gem
75
+ run: |
76
+ gem build *.gemspec
77
+ gem push *.gem
78
+ env:
79
+ RUBY_PLATFORM: 'x86_64-linux-musl'
@@ -0,0 +1,54 @@
1
+ name: Push macOS ARM64 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
+ runs-on: macos-14
20
+ environment: deployment
21
+ permissions:
22
+ contents: write
23
+ id-token: write
24
+ steps:
25
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26
+ with:
27
+ fetch-depth: 0
28
+ - name: Install Bash 4+ and Kerberos
29
+ run: |
30
+ brew install bash
31
+ brew list krb5 &>/dev/null || brew install krb5
32
+ echo "/opt/homebrew/bin" >> $GITHUB_PATH
33
+ - name: Cache build-tmp directory
34
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
35
+ with:
36
+ path: ext/build-tmp-macos
37
+ key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
38
+ - name: Set up Ruby
39
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
40
+ with:
41
+ ruby-version: '3.4'
42
+ bundler-cache: false
43
+ - name: Build precompiled librdkafka for macOS ARM64
44
+ run: |
45
+ cd ext
46
+ /opt/homebrew/bin/bash ./build_macos_arm64.sh
47
+ - name: Configure trusted publishing credentials
48
+ uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
49
+ - name: Build and push platform-specific gem
50
+ run: |
51
+ gem build *.gemspec
52
+ gem push *.gem
53
+ env:
54
+ RUBY_PLATFORM: 'arm64-darwin'
@@ -0,0 +1,37 @@
1
+ name: Push Ruby Platform Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository_owner == 'karafka'
14
+ runs-on: ubuntu-latest
15
+ environment: deployment
16
+
17
+ permissions:
18
+ contents: write
19
+ id-token: write
20
+
21
+ steps:
22
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@472790540115ce5bd69d399a020189a8c87d641f # v1.247.0
28
+ with:
29
+ bundler-cache: false
30
+
31
+ - name: Build rdkafka-ruby
32
+ run: |
33
+ set -e
34
+ bundle install
35
+ cd ext && bundle exec rake
36
+
37
+ - uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
@@ -0,0 +1,16 @@
1
+ name: Verify Action Pins
2
+ on:
3
+ pull_request:
4
+ paths:
5
+ - '.github/workflows/**'
6
+ jobs:
7
+ verify:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
11
+ - name: Check SHA pins
12
+ run: |
13
+ if grep -E -r "uses: .*/.*@(v[0-9]+|main|master)($|[[:space:]]|$)" --include="*.yml" --include="*.yaml" .github/workflows/ | grep -v "#"; then
14
+ echo "::error::Actions should use SHA pins, not tags or branch names"
15
+ exit 1
16
+ fi
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.1
1
+ 3.4.5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Rdkafka Changelog
2
2
 
3
+ ## 0.22.2 (2025-07-21)
4
+ - [Enhancement] Drastically increase number of platforms in the integration suite
5
+ - [Fix] Support Ubuntu `22.04` and older Alpine precompiled versions
6
+ - [Fix] FFI::DynamicLibrary.load_library': Could not open library
7
+
8
+ ## 0.22.1 (2025-07-17)
9
+ - [Fix] Fix `Rakefile` being available in the precompiled versions causing build failures.
10
+
11
+ ## 0.22.0 (2025-07-17)
12
+ - **[Feature]** Add precompiled `x86_64-linux-gnu` setup.
13
+ - **[Feature]** Add precompiled `x86_64-linux-musl` setup.
14
+ - **[Feature]** Add precompiled `macos_arm64` setup.
15
+ - [Fix] Fix a case where using empty key on the `musl` architecture would cause a segfault.
16
+ - [Fix] Fix for null pointer reference bypass on empty string being too wide causing segfault.
17
+ - [Enhancement] Allow for producing to non-existing topics with `key` and `partition_key` present.
18
+ - [Enhancement] Replace TTL-based partition count cache with a global cache that reuses `librdkafka` statistics data when possible.
19
+ - [Enhancement] Support producing and consuming of headers with mulitple values (KIP-82).
20
+ - [Enhancement] Allow native Kafka customization poll time.
21
+ - [Enhancement] Roll out experimental jruby support.
22
+ - [Enhancement] Run all specs on each of the platforms with and without precompilation.
23
+ - [Enhancement] Support transactional id in the ACL API.
24
+ - [Fix] Fix issue where post-closed producer C topics refs would not be cleaned.
25
+ - [Fix] Fiber causes Segmentation Fault.
26
+ - [Change] Move to trusted-publishers and remove signing since no longer needed.
27
+
28
+ **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/).
29
+
3
30
  ## 0.21.0 (2025-02-13)
4
31
  - [Enhancement] Bump librdkafka to `2.8.0`
5
32
 
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.yml/badge.svg)](https://github.com/karafka/rdkafka-ruby/actions/workflows/ci.yml)
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)
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,7 +163,8 @@ bundle exec rake produce_messages
163
163
 
164
164
  | rdkafka-ruby | librdkafka | patches |
165
165
  |-|-|-|
166
- | 0.21.0 (2025-02-13) | 2.8.0 (2025-01-07) | yes |
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 |
167
168
  | 0.20.0 (2025-01-07) | 2.6.1 (2024-11-18) | yes |
168
169
  | 0.19.0 (2024-10-01) | 2.5.3 (2024-09-02) | yes |
169
170
  | 0.18.0 (2024-09-02) | 2.5.0 (2024-06-10) | yes |
data/Rakefile CHANGED
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Rakefile
4
-
5
3
  require 'bundler/gem_tasks'
6
4
  require "./lib/rdkafka"
7
5
 
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:7.8.1
4
+ image: confluentinc/cp-kafka:8.0.0
5
5
 
6
6
  ports:
7
7
  - 9092:9092
data/ext/Rakefile CHANGED
@@ -18,7 +18,7 @@ task :default => :clean do
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 = %x(brew --prefix openssl).strip}") && !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