rdkafka 0.16.0.rc1 → 0.16.1

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: 3132a3d7af1fc531a6259fe3a027e555bfb59183737c3fcffdb5f7e9dc746320
4
- data.tar.gz: 3f1c36a78196660ec0c1b522ff084f63c4c27fa53383864579107a937136cf72
3
+ metadata.gz: 2c95cc0f676ffb0921be329ffa7af3954d9d5111a2312906e06266bb80f19323
4
+ data.tar.gz: 712b70533b65a862c3783cf6cc9179d5d700ea1a657cf5c44d143d52027fc176
5
5
  SHA512:
6
- metadata.gz: 54d9c9b2cb2f788f8b5134241ff312c7afba6b7d260b4bfe2782fc492023d21b93498fe3af5024e0cc2482741bc70969a7219c85fa8cf35c0c65bdd3a76a73ee
7
- data.tar.gz: 9af50d5fc373faf18c5bc1a71d080812bd230a637a40900e3025f97fcfa70df8b9de945b06332c813e9d03316a8eaac6217005f1d733c54be2b8e4b3045c3e9f
6
+ metadata.gz: f78b1b2b11a1d51fb93f9f533e92937aa82731cdf76b24a8940a2dc667e7e6216d639b6983a8de54ba00f3271c1076066caf393cf68028d82cb6297772f4de86
7
+ data.tar.gz: 2bc40080e7aed367bb7c6305ac10054b8e6569e645ddbec29390149124e2f11006661f0b470f8cb864edac18e26281e90649c62cc5b659626960c4a88dfc69f0
checksums.yaml.gz.sig CHANGED
Binary file
@@ -22,6 +22,7 @@ jobs:
22
22
  fail-fast: false
23
23
  matrix:
24
24
  ruby:
25
+ - '3.4.0-preview1'
25
26
  - '3.3'
26
27
  - '3.2'
27
28
  - '3.1'
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.1
1
+ 3.3.3
data/CHANGELOG.md CHANGED
@@ -1,7 +1,12 @@
1
1
  # Rdkafka Changelog
2
2
 
3
- ## 0.16.0 (Unreleased)
3
+ ## 0.16.1 (2024-07-10)
4
+ - [Fix] Switch to local release of librdkafka to mitigate its unavailability.
5
+
6
+ ## 0.16.0 (2024-06-13)
4
7
  - **[Breaking]** Retire support for Ruby 2.7.
8
+ - **[Breaking]** Messages without headers returned by `#poll` contain frozen empty hash.
9
+ - **[Breaking]** `HashWithSymbolKeysTreatedLikeStrings` has been removed so headers are regular hashes with string keys.
5
10
  - **[Feature]** Support incremental config describe + alter API.
6
11
  - **[Feature]** Oauthbearer token refresh callback (bruce-szalwinski-he)
7
12
  - **[Feature]** Provide ability to use topic config on a producer for custom behaviors per dispatch.
@@ -10,6 +15,7 @@
10
15
  - [Enhancement] Replace time poll based wait engine with an event based to improve response times on blocking operations and wait (nijikon + mensfeld)
11
16
  - [Enhancement] Allow for usage of the second regex engine of librdkafka by setting `RDKAFKA_DISABLE_REGEX_EXT` during build (mensfeld)
12
17
  - [Enhancement] name polling Thread as `rdkafka.native_kafka#<name>` (nijikon)
18
+ - [Enhancement] Save two objects on message produced and lower CPU usage on message produced with small improvements.
13
19
  - [Change] Allow for native kafka thread operations deferring and manual start for consumer, producer and admin.
14
20
  - [Change] The `wait_timeout` argument in `AbstractHandle.wait` method is deprecated and will be removed in future versions without replacement. We don't rely on it's value anymore (nijikon)
15
21
  - [Fix] Background logger stops working after forking causing memory leaks (mensfeld)
data/README.md CHANGED
@@ -163,6 +163,7 @@ bundle exec rake produce_messages
163
163
 
164
164
  | rdkafka-ruby | librdkafka |
165
165
  |-|-|
166
+ | 0.16.0 (2024-06-13) | 2.3.0 (2023-10-25) |
166
167
  | 0.15.0 (2023-12-03) | 2.3.0 (2023-10-25) |
167
168
  | 0.14.0 (2023-11-21) | 2.2.0 (2023-07-12) |
168
169
  | 0.13.0 (2023-07-24) | 2.0.2 (2023-01-20) |
Binary file
data/ext/Rakefile CHANGED
@@ -22,8 +22,10 @@ task :default => :clean do
22
22
  ENV["LDFLAGS"] = "-L#{homebrew_prefix}/lib" unless ENV["LDFLAGS"]
23
23
  end
24
24
 
25
+ releases = File.expand_path(File.join(File.dirname(__FILE__), '../dist'))
26
+
25
27
  recipe.files << {
26
- :url => "https://codeload.github.com/edenhill/librdkafka/tar.gz/v#{Rdkafka::LIBRDKAFKA_VERSION}",
28
+ :url => "file://#{releases}/librdkafka_#{Rdkafka::LIBRDKAFKA_VERSION}.tar.gz",
27
29
  :sha256 => Rdkafka::LIBRDKAFKA_SOURCE_SHA256
28
30
  }
29
31
  recipe.configure_options = ["--host=#{recipe.host}"]
@@ -4,17 +4,7 @@ module Rdkafka
4
4
  class Consumer
5
5
  # Interface to return headers for a consumer message
6
6
  module Headers
7
- class HashWithSymbolKeysTreatedLikeStrings < Hash
8
- def [](key)
9
- if key.is_a?(Symbol)
10
- Kernel.warn("rdkafka deprecation warning: header access with Symbol key #{key.inspect} treated as a String. " \
11
- "Please change your code to use String keys to avoid this warning. Symbol keys will break in version 1.")
12
- super(key.to_s)
13
- else
14
- super
15
- end
16
- end
17
- end
7
+ EMPTY_HEADERS = {}.freeze
18
8
 
19
9
  # Reads a librdkafka native message's headers and returns them as a Ruby Hash
20
10
  #
@@ -28,7 +18,7 @@ module Rdkafka
28
18
  err = Rdkafka::Bindings.rd_kafka_message_headers(native_message, headers_ptrptr)
29
19
 
30
20
  if err == Rdkafka::Bindings::RD_KAFKA_RESP_ERR__NOENT
31
- return {}
21
+ return EMPTY_HEADERS
32
22
  elsif err != Rdkafka::Bindings::RD_KAFKA_RESP_ERR_NO_ERROR
33
23
  raise Rdkafka::RdkafkaError.new(err, "Error reading message headers")
34
24
  end
@@ -39,7 +29,7 @@ module Rdkafka
39
29
  value_ptrptr = FFI::MemoryPointer.new(:pointer)
40
30
  size_ptr = Rdkafka::Bindings::SizePtr.new
41
31
 
42
- headers = HashWithSymbolKeysTreatedLikeStrings.new
32
+ headers = {}
43
33
 
44
34
  idx = 0
45
35
  loop do
@@ -14,6 +14,10 @@ module Rdkafka
14
14
  # @return [Object, nil] label set during message production or nil by default
15
15
  attr_accessor :label
16
16
 
17
+ # @return [String] topic where we are trying to send the message
18
+ # We use this instead of reading from `topic_name` pointer to save on memory allocations
19
+ attr_accessor :topic
20
+
17
21
  # @return [String] the name of the operation (e.g. "delivery")
18
22
  def operation_name
19
23
  "delivery"
@@ -26,7 +30,7 @@ module Rdkafka
26
30
  self[:offset],
27
31
  # For part of errors, we will not get a topic name reference and in cases like this
28
32
  # we should not return it
29
- self[:topic_name].null? ? nil : self[:topic_name].read_string,
33
+ topic,
30
34
  self[:response] != 0 ? RdkafkaError.new(self[:response]) : nil,
31
35
  label
32
36
  )
@@ -319,6 +319,7 @@ module Rdkafka
319
319
 
320
320
  delivery_handle = DeliveryHandle.new
321
321
  delivery_handle.label = label
322
+ delivery_handle.topic = topic
322
323
  delivery_handle[:pending] = true
323
324
  delivery_handle[:response] = -1
324
325
  delivery_handle[:partition] = -1
@@ -342,7 +343,7 @@ module Rdkafka
342
343
  args << :int << Rdkafka::Bindings::RD_KAFKA_VTYPE_HEADER
343
344
  args << :string << key
344
345
  args << :pointer << value
345
- args << :size_t << value.bytes.size
346
+ args << :size_t << value.bytesize
346
347
  end
347
348
  end
348
349
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rdkafka
4
- VERSION = "0.16.0.rc1"
4
+ VERSION = "0.16.1"
5
5
  LIBRDKAFKA_VERSION = "2.3.0"
6
6
  LIBRDKAFKA_SOURCE_SHA256 = "2d49c35c77eeb3d42fa61c43757fcbb6a206daa560247154e60642bcdcc14d12"
7
7
  end
@@ -50,11 +50,8 @@ describe Rdkafka::Consumer::Headers do
50
50
  expect(subject['version']).to eq("2.1.3")
51
51
  end
52
52
 
53
- it 'allows Symbol key, but warns' do
54
- expect(Kernel).to \
55
- receive(:warn).with("rdkafka deprecation warning: header access with Symbol key :version treated as a String. " \
56
- "Please change your code to use String keys to avoid this warning. Symbol keys will break in version 1.")
57
- expect(subject[:version]).to eq("2.1.3")
53
+ it 'does not support symbols mappings' do
54
+ expect(subject.key?(:version)).to eq(false)
58
55
  end
59
56
  end
60
57
  end
@@ -9,7 +9,7 @@ describe Rdkafka::Producer::DeliveryHandle do
9
9
  handle[:response] = response
10
10
  handle[:partition] = 2
11
11
  handle[:offset] = 100
12
- handle[:topic_name] = FFI::MemoryPointer.from_string("produce_test_topic")
12
+ handle.topic = "produce_test_topic"
13
13
  end
14
14
  end
15
15
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdkafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0.rc1
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thijs Cadier
@@ -36,7 +36,7 @@ cert_chain:
36
36
  AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
37
37
  msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
38
38
  -----END CERTIFICATE-----
39
- date: 2024-05-27 00:00:00.000000000 Z
39
+ date: 2024-07-10 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ffi
@@ -186,6 +186,7 @@ files:
186
186
  - README.md
187
187
  - Rakefile
188
188
  - certs/cert_chain.pem
189
+ - dist/librdkafka_2.3.0.tar.gz
189
190
  - docker-compose.yml
190
191
  - ext/README.md
191
192
  - ext/Rakefile
@@ -285,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
286
  - !ruby/object:Gem::Version
286
287
  version: '0'
287
288
  requirements: []
288
- rubygems_version: 3.5.9
289
+ rubygems_version: 3.5.11
289
290
  signing_key:
290
291
  specification_version: 4
291
292
  summary: The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka.
metadata.gz.sig CHANGED
Binary file