rdkafka 0.16.0.rc1 → 0.16.0
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 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -1
- data/README.md +1 -0
- data/lib/rdkafka/consumer/headers.rb +3 -13
- data/lib/rdkafka/producer/delivery_handle.rb +5 -1
- data/lib/rdkafka/producer.rb +2 -1
- data/lib/rdkafka/version.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 +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f1bd822870a6f28cd441b95870683442b3d5857f12d85e04057fa29a29121a
|
4
|
+
data.tar.gz: f734cec92e64dfdfbb6a7e3e1875ad402982aeea6d9e8e14befeb50144f2c125
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 644f1435d988fd962cae3031d5d7c7a31de2d618e80def8f48913bda6309e08b81ff62741933b9ada5c40f59f79502e0a9dfee09efcc57fe7845269f178d1738
|
7
|
+
data.tar.gz: 3f83530ade65c38064b1c3a9922c173f973f57b49544fce3fd645a1c6a47ee18506450b33299e6417510f052123114fced56689a6ce2c59abd7d4be11b752c48
|
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,9 @@
|
|
1
1
|
# Rdkafka Changelog
|
2
2
|
|
3
|
-
## 0.16.0 (
|
3
|
+
## 0.16.0 (2024-06-13)
|
4
4
|
- **[Breaking]** Retire support for Ruby 2.7.
|
5
|
+
- **[Breaking]** Messages without headers returned by `#poll` contain frozen empty hash.
|
6
|
+
- **[Breaking]** `HashWithSymbolKeysTreatedLikeStrings` has been removed so headers are regular hashes with string keys.
|
5
7
|
- **[Feature]** Support incremental config describe + alter API.
|
6
8
|
- **[Feature]** Oauthbearer token refresh callback (bruce-szalwinski-he)
|
7
9
|
- **[Feature]** Provide ability to use topic config on a producer for custom behaviors per dispatch.
|
@@ -10,6 +12,7 @@
|
|
10
12
|
- [Enhancement] Replace time poll based wait engine with an event based to improve response times on blocking operations and wait (nijikon + mensfeld)
|
11
13
|
- [Enhancement] Allow for usage of the second regex engine of librdkafka by setting `RDKAFKA_DISABLE_REGEX_EXT` during build (mensfeld)
|
12
14
|
- [Enhancement] name polling Thread as `rdkafka.native_kafka#<name>` (nijikon)
|
15
|
+
- [Enhancement] Save two objects on message produced and lower CPU usage on message produced with small improvements.
|
13
16
|
- [Change] Allow for native kafka thread operations deferring and manual start for consumer, producer and admin.
|
14
17
|
- [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
18
|
- [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) |
|
@@ -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"
|
@@ -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
|
-
|
33
|
+
topic,
|
30
34
|
self[:response] != 0 ? RdkafkaError.new(self[:response]) : nil,
|
31
35
|
label
|
32
36
|
)
|
data/lib/rdkafka/producer.rb
CHANGED
@@ -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.
|
346
|
+
args << :size_t << value.bytesize
|
346
347
|
end
|
347
348
|
end
|
348
349
|
|
data/lib/rdkafka/version.rb
CHANGED
@@ -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: rdkafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.0
|
4
|
+
version: 0.16.0
|
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-13 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: ffi
|
@@ -285,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
285
|
- !ruby/object:Gem::Version
|
286
286
|
version: '0'
|
287
287
|
requirements: []
|
288
|
-
rubygems_version: 3.5.
|
288
|
+
rubygems_version: 3.5.11
|
289
289
|
signing_key:
|
290
290
|
specification_version: 4
|
291
291
|
summary: The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka.
|
metadata.gz.sig
CHANGED
Binary file
|