karafka-rdkafka 0.17.6 → 0.18.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.
- checksums.yaml +4 -4
 - checksums.yaml.gz.sig +0 -0
 - data/.github/workflows/ci.yml +1 -2
 - data/.ruby-version +1 -1
 - data/CHANGELOG.md +7 -0
 - data/README.md +1 -0
 - data/dist/librdkafka-2.6.1.tar.gz +0 -0
 - data/dist/patches/rdkafka_global_init.patch +15 -0
 - data/docker-compose.yml +1 -1
 - data/ext/Rakefile +1 -1
 - data/karafka-rdkafka.gemspec +1 -1
 - data/lib/rdkafka/bindings.rb +5 -0
 - data/lib/rdkafka/config.rb +3 -1
 - data/lib/rdkafka/version.rb +3 -3
 - data/lib/rdkafka.rb +2 -0
 - data/spec/rdkafka/consumer/topic_partition_list_spec.rb +8 -2
 - data.tar.gz.sig +0 -0
 - metadata +6 -6
 - metadata.gz.sig +0 -0
 - data/dist/librdkafka_2.5.3.tar.gz +0 -0
 - data/dist/patches/rdkafka_sticky_assignor.c.patch +0 -26
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: bccd7f77bb5788be32f9f8a3b82ffb40fc602a124fe8f6c2b9c55b6a9557ef4b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c9c48010d8179b6ee80489d66c1425d0ffc6d5255b1ca103abfb5ef565d81370
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 3ae48dd732ba5b392496c126f87d50a65fba7cd1f417828e736b82207a370d87ae64d4b8de0272aa98663b1d515dd6528a1a89bfe0833adda4c21f924b3c07e2
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 5ee6def7731fb42acdcf76a242241204dd837b513c559bb9e16aa58617eb52a9c7320cae5d2d5a91e18876f91237592917e94e2386eba664e160b5d41925632e
         
     | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | 
         Binary file 
     | 
    
        data/.github/workflows/ci.yml
    CHANGED
    
    
    
        data/.ruby-version
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            3.3. 
     | 
| 
      
 1 
     | 
    
         
            +
            3.3.6
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,5 +1,12 @@ 
     | 
|
| 
       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 
     | 
    
         
            +
             
     | 
| 
       3 
10 
     | 
    
         
             
            ## 0.17.6 (2024-09-03)
         
     | 
| 
       4 
11 
     | 
    
         
             
            - [Fix] Fix incorrectly behaving CI on failures. 
         
     | 
| 
       5 
12 
     | 
    
         
             
            - [Fix] Fix invalid patches librdkafka references.
         
     | 
    
        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
    
    
    
        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}/ 
     | 
| 
      
 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}"]
         
     | 
    
        data/karafka-rdkafka.gemspec
    CHANGED
    
    | 
         @@ -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. 
     | 
| 
      
 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 
     | 
    
         | 
    
        data/lib/rdkafka/bindings.rb
    CHANGED
    
    | 
         @@ -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
         
     | 
    
        data/lib/rdkafka/config.rb
    CHANGED
    
    | 
         @@ -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:: 
     | 
| 
      
 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 
     | 
    
         | 
    
        data/lib/rdkafka/version.rb
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module Rdkafka
         
     | 
| 
       4 
     | 
    
         
            -
              VERSION = "0. 
     | 
| 
       5 
     | 
    
         
            -
              LIBRDKAFKA_VERSION = "2. 
     | 
| 
       6 
     | 
    
         
            -
              LIBRDKAFKA_SOURCE_SHA256 = " 
     | 
| 
      
 4 
     | 
    
         
            +
              VERSION = "0.18.0"
         
     | 
| 
      
 5 
     | 
    
         
            +
              LIBRDKAFKA_VERSION = "2.6.1"
         
     | 
| 
      
 6 
     | 
    
         
            +
              LIBRDKAFKA_SOURCE_SHA256 = "0ddf205ad8d36af0bc72a2fec20639ea02e1d583e353163bf7f4683d949e901b"
         
     | 
| 
       7 
7 
     | 
    
         
             
            end
         
     | 
    
        data/lib/rdkafka.rb
    CHANGED
    
    
| 
         @@ -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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.18.0
         
     | 
| 
       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- 
     | 
| 
      
 39 
     | 
    
         
            +
            date: 2024-11-26 00:00:00.000000000 Z
         
     | 
| 
       40 
40 
     | 
    
         
             
            dependencies:
         
     | 
| 
       41 
41 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       42 
42 
     | 
    
         
             
              name: ffi
         
     | 
| 
         @@ -186,8 +186,8 @@ files: 
     | 
|
| 
       186 
186 
     | 
    
         
             
            - README.md
         
     | 
| 
       187 
187 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       188 
188 
     | 
    
         
             
            - certs/cert.pem
         
     | 
| 
       189 
     | 
    
         
            -
            - dist/ 
     | 
| 
       190 
     | 
    
         
            -
            - dist/patches/ 
     | 
| 
      
 189 
     | 
    
         
            +
            - dist/librdkafka-2.6.1.tar.gz
         
     | 
| 
      
 190 
     | 
    
         
            +
            - dist/patches/rdkafka_global_init.patch
         
     | 
| 
       191 
191 
     | 
    
         
             
            - docker-compose.yml
         
     | 
| 
       192 
192 
     | 
    
         
             
            - ext/README.md
         
     | 
| 
       193 
193 
     | 
    
         
             
            - ext/Rakefile
         
     | 
| 
         @@ -280,14 +280,14 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       280 
280 
     | 
    
         
             
              requirements:
         
     | 
| 
       281 
281 
     | 
    
         
             
              - - ">="
         
     | 
| 
       282 
282 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       283 
     | 
    
         
            -
                  version: '3. 
     | 
| 
      
 283 
     | 
    
         
            +
                  version: '3.1'
         
     | 
| 
       284 
284 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       285 
285 
     | 
    
         
             
              requirements:
         
     | 
| 
       286 
286 
     | 
    
         
             
              - - ">="
         
     | 
| 
       287 
287 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       288 
288 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       289 
289 
     | 
    
         
             
            requirements: []
         
     | 
| 
       290 
     | 
    
         
            -
            rubygems_version: 3.5. 
     | 
| 
      
 290 
     | 
    
         
            +
            rubygems_version: 3.5.22
         
     | 
| 
       291 
291 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       292 
292 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       293 
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,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.3/src/rdkafka_sticky_assignor.c	2024-07-08 09:47:43.000000000 +0200
         
     | 
| 
       5 
     | 
    
         
            -
            +++ librdkafka_2.5.3/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 
     | 
    
         
            -
             
         
     |