karafka-rdkafka 0.15.2 → 0.16.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +6 -2
- data/README.md +1 -0
- data/ext/Rakefile +1 -3
- data/karafka-rdkafka.gemspec +1 -1
- data/lib/rdkafka/consumer/headers.rb +3 -13
- data/lib/rdkafka/producer/delivery_handle.rb +6 -4
- data/lib/rdkafka/producer.rb +2 -1
- data/lib/rdkafka/version.rb +3 -3
- data/spec/rdkafka/admin_spec.rb +1 -1
- data/spec/rdkafka/consumer/headers_spec.rb +2 -5
- data/spec/rdkafka/producer/delivery_handle_spec.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -5
- metadata.gz.sig +0 -0
- data/dist/librdkafka_2.3.0.tar.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f42274ae25769bb5ac70ea53d4137270dac420dc9a8074175e5090304c6690df
|
4
|
+
data.tar.gz: dcc6c9d4cc815b5a742a95640b7131e5820042621006dd4bb776da578b0d9b22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72ba8300c81ef41c947788a4329c531f64bca9a255bf147da2477c23a6481d485e6f1a6eefdd3c348c966c4980f6c56bc9b25c2dddf7bed3783816548ce761b3
|
7
|
+
data.tar.gz: 3a7282405f3b58ac8bd3ddbd197256dbfa15e64384cef03370ba6cb3fe87967a2978ea2e9b6532d532f0a38e55ca823d94da14d46b0603238e1a37027411949f
|
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.3
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# Rdkafka Changelog
|
2
2
|
|
3
|
-
## 0.
|
4
|
-
- [
|
3
|
+
## 0.16.0 (Unreleased)
|
4
|
+
- **[Breaking]** Messages without headers returned by `#poll` contain frozen empty hash.
|
5
|
+
- **[Breaking]** `HashWithSymbolKeysTreatedLikeStrings` has been removed so headers are regular hashes with string keys.
|
6
|
+
- [Enhancement] Bump librdkafka to 2.4.0
|
7
|
+
- [Enhancement] Save two objects on message produced and lower CPU usage on message produced with small improvements.
|
8
|
+
- [Fix] Remove support for Ruby 2.7. Supporting it was a bug since rest of the karafka ecosystem no longer supports it.
|
5
9
|
|
6
10
|
## 0.15.1 (2024-05-09)
|
7
11
|
- **[Feature]** Provide ability to use topic config on a producer for custom behaviors per dispatch.
|
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) |
|
data/ext/Rakefile
CHANGED
@@ -22,10 +22,8 @@ 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
|
-
|
27
25
|
recipe.files << {
|
28
|
-
:url => "
|
26
|
+
:url => "https://codeload.github.com/edenhill/librdkafka/tar.gz/v#{Rdkafka::LIBRDKAFKA_VERSION}",
|
29
27
|
:sha256 => Rdkafka::LIBRDKAFKA_SOURCE_SHA256
|
30
28
|
}
|
31
29
|
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 = '>=
|
18
|
+
gem.required_ruby_version = '>= 3.0'
|
19
19
|
gem.extensions = %w(ext/Rakefile)
|
20
20
|
gem.cert_chain = %w[certs/cert_chain.pem]
|
21
21
|
|
@@ -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
|
-
|
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 =
|
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"
|
@@ -25,7 +29,7 @@ module Rdkafka
|
|
25
29
|
DeliveryReport.new(
|
26
30
|
self[:partition],
|
27
31
|
self[:offset],
|
28
|
-
|
32
|
+
topic,
|
29
33
|
nil,
|
30
34
|
label
|
31
35
|
)
|
@@ -33,9 +37,7 @@ module Rdkafka
|
|
33
37
|
DeliveryReport.new(
|
34
38
|
self[:partition],
|
35
39
|
self[:offset],
|
36
|
-
|
37
|
-
# we should not return it
|
38
|
-
self[:topic_name].null? ? nil : self[:topic_name].read_string,
|
40
|
+
topic,
|
39
41
|
Rdkafka::RdkafkaError.build(self[:response]),
|
40
42
|
label
|
41
43
|
)
|
data/lib/rdkafka/producer.rb
CHANGED
@@ -381,6 +381,7 @@ module Rdkafka
|
|
381
381
|
|
382
382
|
delivery_handle = DeliveryHandle.new
|
383
383
|
delivery_handle.label = label
|
384
|
+
delivery_handle.topic = topic
|
384
385
|
delivery_handle[:pending] = true
|
385
386
|
delivery_handle[:response] = -1
|
386
387
|
delivery_handle[:partition] = -1
|
@@ -404,7 +405,7 @@ module Rdkafka
|
|
404
405
|
args << :int << Rdkafka::Bindings::RD_KAFKA_VTYPE_HEADER
|
405
406
|
args << :string << key
|
406
407
|
args << :pointer << value
|
407
|
-
args << :size_t << value.
|
408
|
+
args << :size_t << value.bytesize
|
408
409
|
end
|
409
410
|
end
|
410
411
|
|
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.16.0.rc1"
|
5
|
+
LIBRDKAFKA_VERSION = "2.4.0"
|
6
|
+
LIBRDKAFKA_SOURCE_SHA256 = "d645e47d961db47f1ead29652606a502bdd2a880c85c1e060e94eea040f1a19a"
|
7
7
|
end
|
data/spec/rdkafka/admin_spec.rb
CHANGED
@@ -34,7 +34,7 @@ describe Rdkafka::Admin do
|
|
34
34
|
describe '#describe_errors' do
|
35
35
|
let(:errors) { admin.class.describe_errors }
|
36
36
|
|
37
|
-
it { expect(errors.size).to eq(
|
37
|
+
it { expect(errors.size).to eq(168) }
|
38
38
|
it { expect(errors[-184]).to eq(code: -184, description: 'Local: Queue full', name: '_QUEUE_FULL') }
|
39
39
|
it { expect(errors[21]).to eq(code: 21, description: 'Broker: Invalid required acks value', name: 'INVALID_REQUIRED_ACKS') }
|
40
40
|
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 '
|
54
|
-
expect(
|
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
|
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.16.0.rc1
|
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-
|
39
|
+
date: 2024-06-17 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: ffi
|
@@ -186,7 +186,6 @@ files:
|
|
186
186
|
- README.md
|
187
187
|
- Rakefile
|
188
188
|
- certs/cert_chain.pem
|
189
|
-
- dist/librdkafka_2.3.0.tar.gz
|
190
189
|
- docker-compose.yml
|
191
190
|
- ext/README.md
|
192
191
|
- ext/Rakefile
|
@@ -279,14 +278,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
279
278
|
requirements:
|
280
279
|
- - ">="
|
281
280
|
- !ruby/object:Gem::Version
|
282
|
-
version: '
|
281
|
+
version: '3.0'
|
283
282
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
284
283
|
requirements:
|
285
284
|
- - ">="
|
286
285
|
- !ruby/object:Gem::Version
|
287
286
|
version: '0'
|
288
287
|
requirements: []
|
289
|
-
rubygems_version: 3.5.
|
288
|
+
rubygems_version: 3.5.11
|
290
289
|
signing_key:
|
291
290
|
specification_version: 4
|
292
291
|
summary: The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka.
|
metadata.gz.sig
CHANGED
Binary file
|
Binary file
|