karafka-rdkafka 0.17.5 → 0.18.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f06207b891f56e8feded0ccb4e69302f0eff0418a40603f4493e6b5dbac5d2c5
4
- data.tar.gz: f09a9ddb7fa7f32dcfdae11ff6244f631afe2af2ce0cde256c6ec098b1cd8061
3
+ metadata.gz: 6e328f121d4a410ea1db50fd3661217757f2a772c3060f94abb4f3278ae59558
4
+ data.tar.gz: cb2aeb8e915c5fde19e73c74f91725bf04810a1afd211b9c418c57c936a2f3a7
5
5
  SHA512:
6
- metadata.gz: 00f295b856ec4ecc8ab54b805b8a49c73d213d064952b53930747386ab3641f46de1bcb437c1e5a55a32fdadf44bafae8c0a2a67635465b27cf2c3d811d7fa95
7
- data.tar.gz: 1faec6ed0b725245aab1077885a73df3658bda891ef0b11f93012c093d93f6fa59e2126c3ef30f23fe5a9e496bd38847c5994d677d45d4877f3cc623baa71829
6
+ metadata.gz: a8217261e8118bf53d80e026fd30f8e76013c58babc4783e9f40fbfb706b0991a8ebc9fec94e86c67cf378e35cb57fa8ffa0a9163a87ca8e7b1a40326d24f75a
7
+ data.tar.gz: 20dc090cb6b6934a94497e06041c9fbfdeec1229720bade9f21bfa457bd53d9840a903a968c77d713d40796c048980ae8c6f94bfda1f45f26842681c6a800003
checksums.yaml.gz.sig CHANGED
Binary file
@@ -22,11 +22,10 @@ jobs:
22
22
  fail-fast: false
23
23
  matrix:
24
24
  ruby:
25
- - '3.4.0-preview1'
25
+ - '3.4.0-preview2'
26
26
  - '3.3'
27
27
  - '3.2'
28
28
  - '3.1'
29
- - '3.0'
30
29
  include:
31
30
  - ruby: '3.3'
32
31
  coverage: 'true'
@@ -50,6 +49,8 @@ jobs:
50
49
  GITHUB_COVERAGE: ${{matrix.coverage}}
51
50
 
52
51
  run: |
52
+ set -e
53
53
  bundle install --path vendor/bundle
54
- cd ext && bundle exec rake && cd ..
54
+ cd ext && bundle exec rake
55
+ cd ..
55
56
  bundle exec rspec
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.5
1
+ 3.3.6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Rdkafka Changelog
2
2
 
3
+ ## 0.18.0 (2024-11-26)
4
+ - **[Breaking]** Drop Ruby 3.0 support
5
+ - [Enhancement] Bump librdkafka to 2.6.1
6
+ - [Enhancement] Use default oauth callback if none is passed (bachmanity1)
7
+ - [Enhancement] Expose `rd_kafka_global_init` to mitigate macos forking issues.
8
+ - [Patch] Retire no longer needed cooperative-sticky patch.
9
+
10
+ ## 0.17.6 (2024-09-03)
11
+ - [Fix] Fix incorrectly behaving CI on failures.
12
+ - [Fix] Fix invalid patches librdkafka references.
13
+
3
14
  ## 0.17.5 (2024-09-03)
4
15
  - [Patch] Patch with "Add forward declaration to fix compilation without ssl" fix
5
16
 
data/README.md CHANGED
@@ -163,6 +163,7 @@ bundle exec rake produce_messages
163
163
 
164
164
  | rdkafka-ruby | librdkafka | patches |
165
165
  |-|-|-|
166
+ | 0.18.0 (2024-11-26) | 2.6.1 (2024-11-18) | yes |
166
167
  | 0.17.4 (2024-09-02) | 2.5.3 (2024-09-02) | yes |
167
168
  | 0.17.0 (2024-08-01) | 2.5.0 (2024-07-10) | yes |
168
169
  | 0.16.0 (2024-06-13) | 2.4.0 (2024-05-07) | no |
Binary file
@@ -0,0 +1,15 @@
1
+ # This patch is released under the 2-clause BSD license, same as librdkafka
2
+ #
3
+ --- librdkafka_2.5.3/src/rdkafka.h
4
+ +++ librdkafka_2.5.3/src/rdkafka.h
5
+ @@ -1101,6 +1101,10 @@ rd_kafka_topic_partition_t *rd_kafka_topic_partition_list_find(
6
+ const char *topic,
7
+ int32_t partition);
8
+
9
+ +/**
10
+ + * @brief Allows for the global init of rdkafka when required in the Ruby process.
11
+ + */
12
+ +RD_EXPORT void rd_kafka_global_init(void);
13
+
14
+ /**
15
+ * @brief Sort list using comparator \p cmp.
data/docker-compose.yml CHANGED
@@ -3,7 +3,7 @@ version: '2'
3
3
  services:
4
4
  kafka:
5
5
  container_name: kafka
6
- image: confluentinc/cp-kafka:7.7.0
6
+ image: confluentinc/cp-kafka:7.7.1
7
7
 
8
8
  ports:
9
9
  - 9092:9092
data/ext/Rakefile CHANGED
@@ -26,7 +26,7 @@ task :default => :clean do
26
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",
29
+ :url => "file://#{releases}/librdkafka-#{Rdkafka::LIBRDKAFKA_VERSION}.tar.gz",
30
30
  :sha256 => Rdkafka::LIBRDKAFKA_SOURCE_SHA256
31
31
  }
32
32
  recipe.configure_options = ["--host=#{recipe.host}"]
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.name = 'karafka-rdkafka'
16
16
  gem.require_paths = ['lib']
17
17
  gem.version = Rdkafka::VERSION
18
- gem.required_ruby_version = '>= 3.0'
18
+ gem.required_ruby_version = '>= 3.1'
19
19
  gem.extensions = %w(ext/Rakefile)
20
20
  gem.cert_chain = %w[certs/cert.pem]
21
21
 
@@ -39,6 +39,11 @@ module Rdkafka
39
39
  layout :value, :size_t
40
40
  end
41
41
 
42
+ # This function comes from our patch on top of librdkafka. It allows os to load all the
43
+ # librdkafka components without initializing the client
44
+ # @see https://github.com/confluentinc/librdkafka/issues/4590
45
+ attach_function :rd_kafka_global_init, [], :void
46
+
42
47
  # Polling
43
48
 
44
49
  attach_function :rd_kafka_flush, [:pointer, :int], :int, blocking: true
@@ -338,7 +338,9 @@ module Rdkafka
338
338
  Rdkafka::Bindings.rd_kafka_conf_set_error_cb(config, Rdkafka::Bindings::ErrorCallback)
339
339
 
340
340
  # Set oauth callback
341
- Rdkafka::Bindings.rd_kafka_conf_set_oauthbearer_token_refresh_cb(config, Rdkafka::Bindings::OAuthbearerTokenRefreshCallback)
341
+ if Rdkafka::Config.oauthbearer_token_refresh_callback
342
+ Rdkafka::Bindings.rd_kafka_conf_set_oauthbearer_token_refresh_cb(config, Rdkafka::Bindings::OAuthbearerTokenRefreshCallback)
343
+ end
342
344
  end
343
345
  end
344
346
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rdkafka
4
- VERSION = "0.17.5"
5
- LIBRDKAFKA_VERSION = "2.5.3"
6
- LIBRDKAFKA_SOURCE_SHA256 = "eaa1213fdddf9c43e28834d9a832d9dd732377d35121e42f875966305f52b8ff"
4
+ VERSION = "0.18.0.rc1"
5
+ LIBRDKAFKA_VERSION = "2.6.1"
6
+ LIBRDKAFKA_SOURCE_SHA256 = "0ddf205ad8d36af0bc72a2fec20639ea02e1d583e353163bf7f4683d949e901b"
7
7
  end
data/lib/rdkafka.rb CHANGED
@@ -49,3 +49,5 @@ require "rdkafka/producer/delivery_report"
49
49
  # Main Rdkafka namespace of this gem
50
50
  module Rdkafka
51
51
  end
52
+
53
+ Rdkafka::Bindings.rd_kafka_global_init
@@ -114,12 +114,18 @@ describe Rdkafka::Consumer::TopicPartitionList do
114
114
  end
115
115
 
116
116
  describe "#to_s" do
117
+ let(:expected) do
118
+ if RUBY_VERSION >= '3.4.0'
119
+ "<TopicPartitionList: {\"topic1\" => [<Partition 0>, <Partition 1>]}>"
120
+ else
121
+ "<TopicPartitionList: {\"topic1\"=>[<Partition 0>, <Partition 1>]}>"
122
+ end
123
+ end
124
+
117
125
  it "should return a human readable representation" do
118
126
  list = Rdkafka::Consumer::TopicPartitionList.new
119
127
  list.add_topic("topic1", [0, 1])
120
128
 
121
- expected = "<TopicPartitionList: {\"topic1\"=>[<Partition 0>, <Partition 1>]}>"
122
-
123
129
  expect(list.to_s).to eq expected
124
130
  end
125
131
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-rdkafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.5
4
+ version: 0.18.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thijs Cadier
@@ -36,7 +36,7 @@ cert_chain:
36
36
  i9zWxov0mr44TWegTVeypcWGd/0nxu1+QHVNHJrpqlPBRvwQsUm7fwmRInGpcaB8
37
37
  ap8wNYvryYzrzvzUxIVFBVM5PacgkFqRmolCa8I7tdKQN+R1
38
38
  -----END CERTIFICATE-----
39
- date: 2024-09-03 00:00:00.000000000 Z
39
+ date: 2024-11-26 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ffi
@@ -186,9 +186,8 @@ files:
186
186
  - README.md
187
187
  - Rakefile
188
188
  - certs/cert.pem
189
- - dist/librdkafka_2.5.3.tar.gz
190
- - dist/patches/rdkafka_op.h.patch
191
- - dist/patches/rdkafka_sticky_assignor.c.patch
189
+ - dist/librdkafka-2.6.1.tar.gz
190
+ - dist/patches/rdkafka_global_init.patch
192
191
  - docker-compose.yml
193
192
  - ext/README.md
194
193
  - ext/Rakefile
@@ -281,14 +280,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
281
280
  requirements:
282
281
  - - ">="
283
282
  - !ruby/object:Gem::Version
284
- version: '3.0'
283
+ version: '3.1'
285
284
  required_rubygems_version: !ruby/object:Gem::Requirement
286
285
  requirements:
287
286
  - - ">="
288
287
  - !ruby/object:Gem::Version
289
288
  version: '0'
290
289
  requirements: []
291
- rubygems_version: 3.5.16
290
+ rubygems_version: 3.5.22
292
291
  signing_key:
293
292
  specification_version: 4
294
293
  summary: The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka.
metadata.gz.sig CHANGED
Binary file
Binary file
@@ -1,11 +0,0 @@
1
- # ref https://github.com/confluentinc/librdkafka/pull/4794/files
2
- --- librdkafka_2.5.0/src/rdkafka_op.h 2024-07-08 09:47:43.000000000 +0200
3
- +++ librdkafka_2.5.0/src/rdkafka_op.h 2024-07-30 09:44:38.529759640 +0200
4
- @@ -39,6 +39,7 @@
5
- typedef struct rd_kafka_q_s rd_kafka_q_t;
6
- typedef struct rd_kafka_toppar_s rd_kafka_toppar_t;
7
- typedef struct rd_kafka_op_s rd_kafka_op_t;
8
- +typedef struct rd_kafka_broker_s rd_kafka_broker_t;
9
-
10
- /* One-off reply queue + reply version.
11
- * All APIs that take a rd_kafka_replyq_t makes a copy of the
@@ -1,26 +0,0 @@
1
- # This patch is released under the 2-clause BSD license, same as librdkafka
2
- # Fixes: https://github.com/confluentinc/librdkafka/issues/4783
3
- #
4
- --- librdkafka_2.5.0/src/rdkafka_sticky_assignor.c 2024-07-08 09:47:43.000000000 +0200
5
- +++ librdkafka_2.5.0/src/rdkafka_sticky_assignor.c 2024-07-30 09:44:38.529759640 +0200
6
- @@ -769,7 +769,7 @@
7
- const rd_kafka_topic_partition_list_t *partitions;
8
- const char *consumer;
9
- const rd_map_elem_t *elem;
10
- - int i;
11
- + int i, j;
12
-
13
- /* The assignment is balanced if minimum and maximum numbers of
14
- * partitions assigned to consumers differ by at most one. */
15
- @@ -836,9 +836,9 @@
16
-
17
- /* Otherwise make sure it can't get any more partitions */
18
-
19
- - for (i = 0; i < potentialTopicPartitions->cnt; i++) {
20
- + for (j = 0; j < potentialTopicPartitions->cnt; j++) {
21
- const rd_kafka_topic_partition_t *partition =
22
- - &potentialTopicPartitions->elems[i];
23
- + &potentialTopicPartitions->elems[j];
24
- const char *otherConsumer;
25
- int otherConsumerPartitionCount;
26
-