karafka-rdkafka 0.20.0.rc2 → 0.20.0.rc5
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.
- checksums.yaml +4 -4
- data/.github/workflows/ci_linux_x86_64_gnu.yml +249 -0
- data/.github/workflows/ci_linux_x86_64_musl.yml +205 -0
- data/.github/workflows/ci_macos_arm64.yml +306 -0
- data/.github/workflows/push_linux_x86_64_gnu.yml +64 -0
- data/.github/workflows/push_linux_x86_64_musl.yml +77 -0
- data/.github/workflows/push_macos_arm64.yml +54 -0
- data/.github/workflows/push_ruby.yml +37 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +22 -3
- data/README.md +2 -3
- data/Rakefile +0 -2
- data/dist/{librdkafka-2.10.0.tar.gz → librdkafka-2.8.0.tar.gz} +0 -0
- data/docker-compose.yml +1 -1
- data/ext/Rakefile +1 -1
- data/ext/build_common.sh +361 -0
- data/ext/build_linux_x86_64_gnu.sh +306 -0
- data/ext/build_linux_x86_64_musl.sh +763 -0
- data/ext/build_macos_arm64.sh +550 -0
- data/karafka-rdkafka.gemspec +26 -10
- data/lib/rdkafka/bindings.rb +31 -4
- data/lib/rdkafka/config.rb +4 -1
- data/lib/rdkafka/error.rb +8 -1
- data/lib/rdkafka/native_kafka.rb +4 -0
- data/lib/rdkafka/producer/partitions_count_cache.rb +216 -0
- data/lib/rdkafka/producer.rb +40 -28
- data/lib/rdkafka/version.rb +3 -3
- data/lib/rdkafka.rb +1 -0
- data/renovate.json +74 -0
- data/spec/rdkafka/admin_spec.rb +15 -2
- data/spec/rdkafka/bindings_spec.rb +0 -1
- data/spec/rdkafka/config_spec.rb +1 -1
- data/spec/rdkafka/consumer_spec.rb +35 -14
- data/spec/rdkafka/metadata_spec.rb +2 -2
- data/spec/rdkafka/producer/partitions_count_cache_spec.rb +359 -0
- data/spec/rdkafka/producer/partitions_count_spec.rb +359 -0
- data/spec/rdkafka/producer_spec.rb +198 -7
- data/spec/spec_helper.rb +12 -1
- metadata +43 -100
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +0 -99
- data/Guardfile +0 -19
- data/certs/cert.pem +0 -26
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -3
@@ -0,0 +1,306 @@
|
|
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
|
+
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
|
+
specs_install:
|
60
|
+
timeout-minutes: 30
|
61
|
+
runs-on: macos-latest
|
62
|
+
needs: build_install
|
63
|
+
strategy:
|
64
|
+
fail-fast: false
|
65
|
+
matrix:
|
66
|
+
ruby:
|
67
|
+
- '3.5.0-preview1'
|
68
|
+
- '3.4'
|
69
|
+
- '3.3'
|
70
|
+
- '3.2'
|
71
|
+
- '3.1'
|
72
|
+
include:
|
73
|
+
- ruby: '3.4'
|
74
|
+
coverage: 'true'
|
75
|
+
steps:
|
76
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
77
|
+
with:
|
78
|
+
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
|
+
- name: Install Bash 4+ and Kerberos
|
85
|
+
run: |
|
86
|
+
brew install bash
|
87
|
+
brew list krb5 &>/dev/null || brew install krb5
|
88
|
+
echo "/opt/homebrew/bin" >> $GITHUB_PATH
|
89
|
+
- name: Set up Ruby
|
90
|
+
uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
|
91
|
+
with:
|
92
|
+
ruby-version: ${{matrix.ruby}}
|
93
|
+
bundler-cache: false
|
94
|
+
- name: Install and Start Confluent Community Kafka (KRaft)
|
95
|
+
run: |
|
96
|
+
brew install openjdk@17
|
97
|
+
export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
|
98
|
+
export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
|
99
|
+
|
100
|
+
curl -O "https://packages.confluent.io/archive/8.0/confluent-community-${CONFLUENT_VERSION}.tar.gz"
|
101
|
+
tar -xzf "confluent-community-${CONFLUENT_VERSION}.tar.gz"
|
102
|
+
|
103
|
+
export CONFLUENT_HOME="$(pwd)/confluent-${CONFLUENT_VERSION}"
|
104
|
+
export PATH="$CONFLUENT_HOME/bin:$PATH"
|
105
|
+
cd "$CONFLUENT_HOME"
|
106
|
+
|
107
|
+
# Find the correct server config
|
108
|
+
KRAFT_CONFIG=""
|
109
|
+
for config in "etc/kafka/kraft/server.properties" "config/kraft/server.properties" "etc/kafka/server.properties"; do
|
110
|
+
if [ -f "$config" ]; then
|
111
|
+
KRAFT_CONFIG="$config"
|
112
|
+
echo "Found config: $KRAFT_CONFIG"
|
113
|
+
break
|
114
|
+
fi
|
115
|
+
done
|
116
|
+
|
117
|
+
if [ -z "$KRAFT_CONFIG" ]; then
|
118
|
+
echo "❌ No server config found"
|
119
|
+
exit 1
|
120
|
+
fi
|
121
|
+
|
122
|
+
# Configure KRaft for single-node setup
|
123
|
+
cat >> "$KRAFT_CONFIG" << 'EOF'
|
124
|
+
|
125
|
+
# KRaft mode configuration for single-node setup
|
126
|
+
process.roles=broker,controller
|
127
|
+
node.id=1
|
128
|
+
controller.quorum.voters=1@127.0.0.1:9093
|
129
|
+
listeners=PLAINTEXT://127.0.0.1:9092,CONTROLLER://127.0.0.1:9093
|
130
|
+
controller.listener.names=CONTROLLER
|
131
|
+
inter.broker.listener.name=PLAINTEXT
|
132
|
+
log.dirs=/tmp/kraft-combined-logs
|
133
|
+
|
134
|
+
# Enable simple ACL authorization for testing
|
135
|
+
authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer
|
136
|
+
super.users=User:ANONYMOUS
|
137
|
+
allow.everyone.if.no.acl.found=true
|
138
|
+
EOF
|
139
|
+
|
140
|
+
echo "Updated KRaft configuration"
|
141
|
+
|
142
|
+
CLUSTER_ID=$(bin/kafka-storage random-uuid)
|
143
|
+
bin/kafka-storage format -t "$CLUSTER_ID" -c "$KRAFT_CONFIG"
|
144
|
+
bin/kafka-server-start "$KRAFT_CONFIG" &
|
145
|
+
|
146
|
+
sleep 20
|
147
|
+
|
148
|
+
for i in {1..30}; do
|
149
|
+
if bin/kafka-topics --bootstrap-server 127.0.0.1:9092 --list >/dev/null 2>&1; then
|
150
|
+
echo "✅ Confluent Community ${CONFLUENT_VERSION} (KRaft) is ready!"
|
151
|
+
break
|
152
|
+
fi
|
153
|
+
[ $i -eq 30 ] && { echo "❌ Kafka failed to start"; exit 1; }
|
154
|
+
sleep 2
|
155
|
+
done
|
156
|
+
- name: Install remaining dependencies
|
157
|
+
env:
|
158
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
159
|
+
run: |
|
160
|
+
# Only install gems that aren't Ruby-version specific
|
161
|
+
bundle install
|
162
|
+
- name: Run all specs
|
163
|
+
env:
|
164
|
+
GITHUB_COVERAGE: ${{matrix.coverage}}
|
165
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
166
|
+
run: |
|
167
|
+
bundle exec rspec
|
168
|
+
|
169
|
+
build_precompiled:
|
170
|
+
timeout-minutes: 45
|
171
|
+
runs-on: macos-latest
|
172
|
+
steps:
|
173
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
174
|
+
with:
|
175
|
+
fetch-depth: 0
|
176
|
+
- name: Install Bash 4+ and Kerberos
|
177
|
+
run: |
|
178
|
+
brew install bash
|
179
|
+
brew list krb5 &>/dev/null || brew install krb5
|
180
|
+
echo "/opt/homebrew/bin" >> $GITHUB_PATH
|
181
|
+
- name: Cache build-tmp directory
|
182
|
+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
183
|
+
with:
|
184
|
+
path: ext/build-tmp-macos
|
185
|
+
key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
|
186
|
+
- name: Build precompiled librdkafka for macOS ARM64
|
187
|
+
run: |
|
188
|
+
cd ext
|
189
|
+
/opt/homebrew/bin/bash ./build_macos_arm64.sh
|
190
|
+
- name: Upload precompiled library
|
191
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
192
|
+
with:
|
193
|
+
name: librdkafka-precompiled-macos
|
194
|
+
path: ext/
|
195
|
+
retention-days: 1
|
196
|
+
|
197
|
+
specs_precompiled:
|
198
|
+
timeout-minutes: 30
|
199
|
+
runs-on: macos-latest
|
200
|
+
needs: build_precompiled
|
201
|
+
strategy:
|
202
|
+
fail-fast: false
|
203
|
+
matrix:
|
204
|
+
ruby:
|
205
|
+
- '3.5.0-preview1'
|
206
|
+
- '3.4'
|
207
|
+
- '3.3'
|
208
|
+
- '3.2'
|
209
|
+
- '3.1'
|
210
|
+
include:
|
211
|
+
- ruby: '3.4'
|
212
|
+
coverage: 'true'
|
213
|
+
steps:
|
214
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
215
|
+
with:
|
216
|
+
fetch-depth: 0
|
217
|
+
- name: Download precompiled library
|
218
|
+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
219
|
+
with:
|
220
|
+
name: librdkafka-precompiled-macos
|
221
|
+
path: ext/
|
222
|
+
- name: Set up Ruby
|
223
|
+
uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
|
224
|
+
with:
|
225
|
+
ruby-version: ${{ matrix.ruby }}
|
226
|
+
bundler-cache: false
|
227
|
+
- name: Install Bash 4+ and Kerberos
|
228
|
+
run: |
|
229
|
+
brew install bash
|
230
|
+
brew list krb5 &>/dev/null || brew install krb5
|
231
|
+
echo "/opt/homebrew/bin" >> $GITHUB_PATH
|
232
|
+
- name: Install and Start Confluent Community Kafka (KRaft)
|
233
|
+
run: |
|
234
|
+
brew install openjdk@17
|
235
|
+
export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
|
236
|
+
export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
|
237
|
+
|
238
|
+
curl -O "https://packages.confluent.io/archive/8.0/confluent-community-${CONFLUENT_VERSION}.tar.gz"
|
239
|
+
tar -xzf "confluent-community-${CONFLUENT_VERSION}.tar.gz"
|
240
|
+
|
241
|
+
export CONFLUENT_HOME="$(pwd)/confluent-${CONFLUENT_VERSION}"
|
242
|
+
export PATH="$CONFLUENT_HOME/bin:$PATH"
|
243
|
+
cd "$CONFLUENT_HOME"
|
244
|
+
|
245
|
+
# Find the correct server config
|
246
|
+
KRAFT_CONFIG=""
|
247
|
+
for config in "etc/kafka/kraft/server.properties" "config/kraft/server.properties" "etc/kafka/server.properties"; do
|
248
|
+
if [ -f "$config" ]; then
|
249
|
+
KRAFT_CONFIG="$config"
|
250
|
+
echo "Found config: $KRAFT_CONFIG"
|
251
|
+
break
|
252
|
+
fi
|
253
|
+
done
|
254
|
+
|
255
|
+
if [ -z "$KRAFT_CONFIG" ]; then
|
256
|
+
echo "❌ No server config found"
|
257
|
+
exit 1
|
258
|
+
fi
|
259
|
+
|
260
|
+
# Configure KRaft for single-node setup
|
261
|
+
cat >> "$KRAFT_CONFIG" << 'EOF'
|
262
|
+
|
263
|
+
# KRaft mode configuration for single-node setup
|
264
|
+
process.roles=broker,controller
|
265
|
+
node.id=1
|
266
|
+
controller.quorum.voters=1@127.0.0.1:9093
|
267
|
+
listeners=PLAINTEXT://127.0.0.1:9092,CONTROLLER://127.0.0.1:9093
|
268
|
+
controller.listener.names=CONTROLLER
|
269
|
+
inter.broker.listener.name=PLAINTEXT
|
270
|
+
log.dirs=/tmp/kraft-combined-logs
|
271
|
+
|
272
|
+
# Enable simple ACL authorization for testing
|
273
|
+
authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer
|
274
|
+
super.users=User:ANONYMOUS
|
275
|
+
allow.everyone.if.no.acl.found=true
|
276
|
+
EOF
|
277
|
+
|
278
|
+
echo "Updated KRaft configuration"
|
279
|
+
|
280
|
+
CLUSTER_ID=$(bin/kafka-storage random-uuid)
|
281
|
+
bin/kafka-storage format -t "$CLUSTER_ID" -c "$KRAFT_CONFIG"
|
282
|
+
bin/kafka-server-start "$KRAFT_CONFIG" &
|
283
|
+
|
284
|
+
sleep 20
|
285
|
+
|
286
|
+
for i in {1..30}; do
|
287
|
+
if bin/kafka-topics --bootstrap-server 127.0.0.1:9092 --list >/dev/null 2>&1; then
|
288
|
+
echo "✅ Confluent Community ${CONFLUENT_VERSION} (KRaft) is ready!"
|
289
|
+
break
|
290
|
+
fi
|
291
|
+
[ $i -eq 30 ] && { echo "❌ Kafka failed to start"; exit 1; }
|
292
|
+
sleep 2
|
293
|
+
done
|
294
|
+
- name: Install bundle with precompiled library
|
295
|
+
env:
|
296
|
+
GITHUB_COVERAGE: ${{ matrix.coverage }}
|
297
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
298
|
+
run: |
|
299
|
+
bundle install
|
300
|
+
echo "Bundle install completed with precompiled library"
|
301
|
+
- name: Run specs with precompiled library
|
302
|
+
env:
|
303
|
+
GITHUB_COVERAGE: ${{ matrix.coverage }}
|
304
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
305
|
+
run: |
|
306
|
+
bundle exec rspec
|
@@ -0,0 +1,64 @@
|
|
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
|
+
runs-on: ubuntu-latest
|
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 build dependencies
|
29
|
+
run: |
|
30
|
+
sudo apt-get update
|
31
|
+
sudo apt-get install -y --no-install-recommends \
|
32
|
+
build-essential \
|
33
|
+
gcc \
|
34
|
+
make \
|
35
|
+
patch \
|
36
|
+
tar \
|
37
|
+
wget \
|
38
|
+
ca-certificates \
|
39
|
+
libsasl2-dev \
|
40
|
+
libssl-dev \
|
41
|
+
zlib1g-dev \
|
42
|
+
libzstd-dev
|
43
|
+
- name: Cache build-tmp directory
|
44
|
+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
45
|
+
with:
|
46
|
+
path: ext/build-tmp
|
47
|
+
key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh') }}
|
48
|
+
- name: Set up Ruby
|
49
|
+
uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
|
50
|
+
with:
|
51
|
+
ruby-version: '3.4'
|
52
|
+
bundler-cache: false
|
53
|
+
- name: Build precompiled librdkafka.so
|
54
|
+
run: |
|
55
|
+
cd ext
|
56
|
+
./build_linux_x86_64_gnu.sh
|
57
|
+
- name: Configure trusted publishing credentials
|
58
|
+
uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
|
59
|
+
- name: Build and push platform-specific gem
|
60
|
+
run: |
|
61
|
+
gem build *.gemspec
|
62
|
+
gem push *.gem
|
63
|
+
env:
|
64
|
+
RUBY_PLATFORM: 'x86_64-linux-gnu'
|
@@ -0,0 +1,77 @@
|
|
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
|
+
image: alpine:3.22@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be023728e11715
|
19
|
+
steps:
|
20
|
+
- name: Install dependencies
|
21
|
+
run: |
|
22
|
+
apk add --no-cache git curl ca-certificates build-base linux-headers \
|
23
|
+
pkgconf perl autoconf automake libtool bison flex file bash wget zstd-dev \
|
24
|
+
openssl-dev cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
25
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
26
|
+
krb5-libs openssl zlib zlib-dev zstd-libs
|
27
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
28
|
+
with:
|
29
|
+
fetch-depth: 0
|
30
|
+
- name: Configure git safe directory
|
31
|
+
run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
|
32
|
+
- name: Cache build-tmp directory
|
33
|
+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
34
|
+
with:
|
35
|
+
path: ext/build-tmp-musl
|
36
|
+
key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
|
37
|
+
- name: Build precompiled librdkafka.so
|
38
|
+
run: |
|
39
|
+
cd ext
|
40
|
+
bash ./build_linux_x86_64_musl.sh
|
41
|
+
- name: Upload precompiled library
|
42
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
43
|
+
with:
|
44
|
+
name: librdkafka-precompiled-musl
|
45
|
+
path: ext/
|
46
|
+
retention-days: 1
|
47
|
+
push:
|
48
|
+
if: github.repository_owner == 'karafka'
|
49
|
+
timeout-minutes: 30
|
50
|
+
runs-on: ubuntu-latest
|
51
|
+
needs: build
|
52
|
+
environment: deployment
|
53
|
+
permissions:
|
54
|
+
contents: write
|
55
|
+
id-token: write
|
56
|
+
steps:
|
57
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
58
|
+
with:
|
59
|
+
fetch-depth: 0
|
60
|
+
- name: Download precompiled library
|
61
|
+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
62
|
+
with:
|
63
|
+
name: librdkafka-precompiled-musl
|
64
|
+
path: ext/
|
65
|
+
- name: Set up Ruby
|
66
|
+
uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
|
67
|
+
with:
|
68
|
+
ruby-version: '3.4'
|
69
|
+
bundler-cache: false
|
70
|
+
- name: Configure trusted publishing credentials
|
71
|
+
uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
|
72
|
+
- name: Build and push platform-specific gem
|
73
|
+
run: |
|
74
|
+
gem build *.gemspec
|
75
|
+
gem push *.gem
|
76
|
+
env:
|
77
|
+
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-latest
|
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@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.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
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.4.
|
1
|
+
3.4.4
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,29 @@
|
|
1
1
|
# Rdkafka Changelog
|
2
2
|
|
3
3
|
## 0.20.0 (Unreleased)
|
4
|
-
- [
|
5
|
-
- [
|
4
|
+
- **[Feature]** Add precompiled `x86_64-linux-gnu` setup.
|
5
|
+
- **[Feature]** Add precompiled `x86_64-linux-musl` setup.
|
6
|
+
- **[Feature]** Add precompiled `macos_arm64` setup.
|
7
|
+
- [Enhancement] Run all specs on each of the platforms with and without precompilation.
|
8
|
+
- [Fix] Fix a case where using empty key on the `musl` architecture would cause a segfault.
|
9
|
+
|
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.
|
11
|
+
|
12
|
+
## 0.19.5 (2025-05-30)
|
13
|
+
- [Enhancement] Allow for producing to non-existing topics with `key` and `partition_key` present.
|
14
|
+
|
15
|
+
## 0.19.4 (2025-05-23)
|
16
|
+
- [Change] Move to trusted-publishers and remove signing since no longer needed.
|
17
|
+
|
18
|
+
## 0.19.3 (2025-05-23)
|
19
|
+
- [Enhancement] Include broker message in the error full message if provided.
|
20
|
+
|
21
|
+
## 0.19.2 (2025-05-20)
|
22
|
+
- [Enhancement] Replace TTL-based partition count cache with a global cache that reuses `librdkafka` statistics data when possible.
|
6
23
|
- [Enhancement] Roll out experimental jruby support.
|
7
|
-
- [
|
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.
|
8
27
|
|
9
28
|
## 0.19.1 (2025-04-07)
|
10
29
|
- [Enhancement] Support producing and consuming of headers with mulitple values (KIP-82).
|
data/README.md
CHANGED
@@ -163,9 +163,8 @@ bundle exec rake produce_messages
|
|
163
163
|
|
164
164
|
| rdkafka-ruby | librdkafka | patches |
|
165
165
|
|-|-|-|
|
166
|
-
| 0.20.
|
167
|
-
| 0.19.
|
168
|
-
| 0.19.0 (2025-01-20) | 2.8.0 (2025-01-07) | yes |
|
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 |
|
169
168
|
| 0.18.0 (2024-11-26) | 2.6.1 (2024-11-18) | yes |
|
170
169
|
| 0.17.4 (2024-09-02) | 2.5.3 (2024-09-02) | yes |
|
171
170
|
| 0.17.0 (2024-08-01) | 2.5.0 (2024-07-10) | yes |
|
data/Rakefile
CHANGED
Binary file
|
data/docker-compose.yml
CHANGED
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
|