rdkafka 0.13.0.beta.5 → 0.13.0.beta.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -4
- data/lib/rdkafka/bindings.rb +2 -4
- data/lib/rdkafka/config.rb +4 -4
- data/lib/rdkafka/metadata.rb +2 -2
- data/lib/rdkafka/version.rb +3 -3
- data/spec/rdkafka/consumer_spec.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a4ea932db3e81e325c31d9e1aedd5604eccc30d1faa865cac5986a66c59ddaa
|
4
|
+
data.tar.gz: b8da648c6ac7f83ba48c7e19a391e918dc4ed7d9bdc6ab57d9479b43b34760e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4f25d641d18a7a1f2b2b6bc3f56ae9a56c26212a46d809f3d97a02bc41bf4bc1094d208762d3c3e96087222fa4ed6dfeacf4fab3967c93fd02540f999678f1d
|
7
|
+
data.tar.gz: 19f7832ccfce84daf5faca7eb3c74c37ab5dcdf7e60a40fed9cb10e99408a3baf61a310cdae9e63835b201b757428beb7b5c8f57cc1c82f6b99dd8b1bf280286
|
data/CHANGELOG.md
CHANGED
@@ -5,12 +5,14 @@
|
|
5
5
|
* Add topic name to delivery report (maeve)
|
6
6
|
* Allow string partitioner config (mollyegibson)
|
7
7
|
* Fix documented type for DeliveryReport#error (jimmydo)
|
8
|
-
* Bump librdkafka to
|
8
|
+
* Bump librdkafka to 2.0.2 (lmaia)
|
9
9
|
* Use finalizers to cleanly exit producer and admin (thijsc)
|
10
10
|
* Lock access to the native kafka client (thijsc)
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
* Fix potential race condition in multi-threaded producer (mensfeld)
|
12
|
+
* Fix leaking FFI resources in specs (mensfeld)
|
13
|
+
* Improve specs stability (mensfeld)
|
14
|
+
* Make metadata request timeout configurable (mensfeld)
|
15
|
+
* call_on_partitions_assigned and call_on_partitions_revoked only get a tpl passed in (thijsc)
|
14
16
|
|
15
17
|
# 0.12.0
|
16
18
|
* Bumps librdkafka to 1.9.0
|
data/lib/rdkafka/bindings.rb
CHANGED
@@ -222,14 +222,12 @@ module Rdkafka
|
|
222
222
|
return unless opaque
|
223
223
|
|
224
224
|
tpl = Rdkafka::Consumer::TopicPartitionList.from_native_tpl(partitions_ptr).freeze
|
225
|
-
consumer = Rdkafka::Consumer.new(client_ptr)
|
226
|
-
|
227
225
|
begin
|
228
226
|
case code
|
229
227
|
when RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS
|
230
|
-
opaque.call_on_partitions_assigned(
|
228
|
+
opaque.call_on_partitions_assigned(tpl)
|
231
229
|
when RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS
|
232
|
-
opaque.call_on_partitions_revoked(
|
230
|
+
opaque.call_on_partitions_revoked(tpl)
|
233
231
|
end
|
234
232
|
rescue Exception => err
|
235
233
|
Rdkafka::Config.logger.error("Unhandled exception: #{err.class} - #{err.message}")
|
data/lib/rdkafka/config.rb
CHANGED
@@ -285,18 +285,18 @@ module Rdkafka
|
|
285
285
|
producer.call_delivery_callback(delivery_report, delivery_handle) if producer
|
286
286
|
end
|
287
287
|
|
288
|
-
def call_on_partitions_assigned(
|
288
|
+
def call_on_partitions_assigned(list)
|
289
289
|
return unless consumer_rebalance_listener
|
290
290
|
return unless consumer_rebalance_listener.respond_to?(:on_partitions_assigned)
|
291
291
|
|
292
|
-
consumer_rebalance_listener.on_partitions_assigned(
|
292
|
+
consumer_rebalance_listener.on_partitions_assigned(list)
|
293
293
|
end
|
294
294
|
|
295
|
-
def call_on_partitions_revoked(
|
295
|
+
def call_on_partitions_revoked(list)
|
296
296
|
return unless consumer_rebalance_listener
|
297
297
|
return unless consumer_rebalance_listener.respond_to?(:on_partitions_revoked)
|
298
298
|
|
299
|
-
consumer_rebalance_listener.on_partitions_revoked(
|
299
|
+
consumer_rebalance_listener.on_partitions_revoked(list)
|
300
300
|
end
|
301
301
|
end
|
302
302
|
end
|
data/lib/rdkafka/metadata.rb
CHANGED
@@ -4,7 +4,7 @@ module Rdkafka
|
|
4
4
|
class Metadata
|
5
5
|
attr_reader :brokers, :topics
|
6
6
|
|
7
|
-
def initialize(native_client, topic_name = nil)
|
7
|
+
def initialize(native_client, topic_name = nil, timeout_ms = 250)
|
8
8
|
native_topic = if topic_name
|
9
9
|
Rdkafka::Bindings.rd_kafka_topic_new(native_client, topic_name, nil)
|
10
10
|
end
|
@@ -16,7 +16,7 @@ module Rdkafka
|
|
16
16
|
topic_flag = topic_name.nil? ? 1 : 0
|
17
17
|
|
18
18
|
# Retrieve the Metadata
|
19
|
-
result = Rdkafka::Bindings.rd_kafka_metadata(native_client, topic_flag, native_topic, ptr,
|
19
|
+
result = Rdkafka::Bindings.rd_kafka_metadata(native_client, topic_flag, native_topic, ptr, timeout_ms)
|
20
20
|
|
21
21
|
# Error Handling
|
22
22
|
raise Rdkafka::RdkafkaError.new(result) unless result.zero?
|
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.13.0.beta.
|
5
|
-
LIBRDKAFKA_VERSION = "
|
6
|
-
LIBRDKAFKA_SOURCE_SHA256 = "
|
4
|
+
VERSION = "0.13.0.beta.7"
|
5
|
+
LIBRDKAFKA_VERSION = "2.0.2"
|
6
|
+
LIBRDKAFKA_SOURCE_SHA256 = "f321bcb1e015a34114c83cf1aa7b99ee260236aab096b85c003170c90a47ca9d"
|
7
7
|
end
|
@@ -937,11 +937,11 @@ describe Rdkafka::Consumer do
|
|
937
937
|
context "with a working listener" do
|
938
938
|
let(:listener) do
|
939
939
|
Struct.new(:queue) do
|
940
|
-
def on_partitions_assigned(
|
940
|
+
def on_partitions_assigned(list)
|
941
941
|
collect(:assign, list)
|
942
942
|
end
|
943
943
|
|
944
|
-
def on_partitions_revoked(
|
944
|
+
def on_partitions_revoked(list)
|
945
945
|
collect(:revoke, list)
|
946
946
|
end
|
947
947
|
|
@@ -965,12 +965,12 @@ describe Rdkafka::Consumer do
|
|
965
965
|
context "with a broken listener" do
|
966
966
|
let(:listener) do
|
967
967
|
Struct.new(:queue) do
|
968
|
-
def on_partitions_assigned(
|
968
|
+
def on_partitions_assigned(list)
|
969
969
|
queue << :assigned
|
970
970
|
raise 'boom'
|
971
971
|
end
|
972
972
|
|
973
|
-
def on_partitions_revoked(
|
973
|
+
def on_partitions_revoked(list)
|
974
974
|
queue << :revoked
|
975
975
|
raise 'boom'
|
976
976
|
end
|
@@ -1037,11 +1037,11 @@ describe Rdkafka::Consumer do
|
|
1037
1037
|
|
1038
1038
|
let(:listener) do
|
1039
1039
|
Struct.new(:queue) do
|
1040
|
-
def on_partitions_assigned(
|
1040
|
+
def on_partitions_assigned(list)
|
1041
1041
|
collect(:assign, list)
|
1042
1042
|
end
|
1043
1043
|
|
1044
|
-
def on_partitions_revoked(
|
1044
|
+
def on_partitions_revoked(list)
|
1045
1045
|
collect(:revoke, list)
|
1046
1046
|
end
|
1047
1047
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdkafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.0.beta.
|
4
|
+
version: 0.13.0.beta.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thijs Cadier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|