karafka-rdkafka 0.12.4 → 0.13.0.beta1
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/CHANGELOG.md +21 -2
- data/Gemfile +2 -0
- data/README.md +26 -0
- data/Rakefile +2 -0
- data/certs/cert_chain.pem +21 -21
- data/certs/karafka-pro.pem +11 -0
- data/ext/Rakefile +26 -53
- data/karafka-rdkafka.gemspec +2 -0
- data/lib/rdkafka/abstract_handle.rb +2 -0
- data/lib/rdkafka/admin/create_topic_handle.rb +2 -0
- data/lib/rdkafka/admin/create_topic_report.rb +2 -0
- data/lib/rdkafka/admin/delete_topic_handle.rb +2 -0
- data/lib/rdkafka/admin/delete_topic_report.rb +2 -0
- data/lib/rdkafka/admin.rb +95 -73
- data/lib/rdkafka/bindings.rb +52 -37
- data/lib/rdkafka/callbacks.rb +2 -0
- data/lib/rdkafka/config.rb +13 -10
- data/lib/rdkafka/consumer/headers.rb +24 -7
- data/lib/rdkafka/consumer/message.rb +3 -1
- data/lib/rdkafka/consumer/partition.rb +2 -0
- data/lib/rdkafka/consumer/topic_partition_list.rb +2 -0
- data/lib/rdkafka/consumer.rb +100 -44
- data/lib/rdkafka/error.rb +9 -0
- data/lib/rdkafka/metadata.rb +25 -2
- data/lib/rdkafka/native_kafka.rb +83 -0
- data/lib/rdkafka/producer/delivery_handle.rb +2 -0
- data/lib/rdkafka/producer/delivery_report.rb +3 -1
- data/lib/rdkafka/producer.rb +75 -12
- data/lib/rdkafka/version.rb +3 -1
- data/lib/rdkafka.rb +3 -1
- data/spec/rdkafka/abstract_handle_spec.rb +2 -0
- data/spec/rdkafka/admin/create_topic_handle_spec.rb +2 -0
- data/spec/rdkafka/admin/create_topic_report_spec.rb +2 -0
- data/spec/rdkafka/admin/delete_topic_handle_spec.rb +2 -0
- data/spec/rdkafka/admin/delete_topic_report_spec.rb +2 -0
- data/spec/rdkafka/admin_spec.rb +4 -3
- data/spec/rdkafka/bindings_spec.rb +2 -0
- data/spec/rdkafka/callbacks_spec.rb +2 -0
- data/spec/rdkafka/config_spec.rb +17 -2
- data/spec/rdkafka/consumer/headers_spec.rb +62 -0
- data/spec/rdkafka/consumer/message_spec.rb +2 -0
- data/spec/rdkafka/consumer/partition_spec.rb +2 -0
- data/spec/rdkafka/consumer/topic_partition_list_spec.rb +2 -0
- data/spec/rdkafka/consumer_spec.rb +124 -22
- data/spec/rdkafka/error_spec.rb +2 -0
- data/spec/rdkafka/metadata_spec.rb +2 -0
- data/spec/rdkafka/{producer/client_spec.rb → native_kafka_spec.rb} +13 -34
- data/spec/rdkafka/producer/delivery_handle_spec.rb +2 -0
- data/spec/rdkafka/producer/delivery_report_spec.rb +4 -2
- data/spec/rdkafka/producer_spec.rb +118 -17
- data/spec/spec_helper.rb +17 -1
- data.tar.gz.sig +0 -0
- metadata +33 -33
- metadata.gz.sig +0 -0
- data/bin/console +0 -11
- data/dist/librdkafka_2.0.2.tar.gz +0 -0
- data/lib/rdkafka/producer/client.rb +0 -47
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.13.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thijs Cadier
|
@@ -12,30 +12,30 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MRAwDgYDVQQDDAdjb250
|
14
14
|
YWN0MRcwFQYKCZImiZPyLGQBGRYHa2FyYWZrYTESMBAGCgmSJomT8ixkARkWAmlv
|
15
|
-
|
15
|
+
MB4XDTIyMDgxOTE3MjEzN1oXDTIzMDgxOTE3MjEzN1owPzEQMA4GA1UEAwwHY29u
|
16
16
|
dGFjdDEXMBU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AOCAYEA1aS+E7RXJ1w9g9mJ
|
29
|
+
G0NzFxe64OEuENosNlvYQCbRKGCXAU1qqelYkBQHseRgRKxLICrnypRo9IEobyHa
|
30
|
+
vDnJ4r7Tsb34dleqQW2zY/obG+cia3Ym2JsegXWF7dDOzCXJ4FN8MFoT2jHlqLLw
|
31
|
+
yrap0YO5zx0GSQ0Dwy8h2n2v2vanMEeCx7iNm3ERgR5WuN5sjzWoz2A/JLEEcK0C
|
32
|
+
EnAGKCWAd1fuG8IemDjT1edsd5FyYR4bIX0m+99oDuFZyPiiIbalmyYiSBBp59Yb
|
33
|
+
Q0P8zeBi4OfwCZNcxqz0KONmw9JLNv6DgyEAH5xe/4JzhMEgvIRiPj0pHfA7oqQF
|
34
|
+
KUNqvD1KlxbEC+bZfE5IZhnqYLdld/Ksqd22FI1RBhiS1Ejfsj99LVIm9cBuZEY2
|
35
|
+
Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
|
36
|
+
MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2023-06-15 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: ffi
|
@@ -166,8 +166,7 @@ dependencies:
|
|
166
166
|
description: Modern Kafka client library for Ruby based on librdkafka
|
167
167
|
email:
|
168
168
|
- thijs@appsignal.com
|
169
|
-
executables:
|
170
|
-
- console
|
169
|
+
executables: []
|
171
170
|
extensions:
|
172
171
|
- ext/Rakefile
|
173
172
|
extra_rdoc_files: []
|
@@ -182,9 +181,8 @@ files:
|
|
182
181
|
- LICENSE
|
183
182
|
- README.md
|
184
183
|
- Rakefile
|
185
|
-
- bin/console
|
186
184
|
- certs/cert_chain.pem
|
187
|
-
-
|
185
|
+
- certs/karafka-pro.pem
|
188
186
|
- docker-compose.yml
|
189
187
|
- ext/README.md
|
190
188
|
- ext/Rakefile
|
@@ -208,8 +206,8 @@ files:
|
|
208
206
|
- lib/rdkafka/consumer/topic_partition_list.rb
|
209
207
|
- lib/rdkafka/error.rb
|
210
208
|
- lib/rdkafka/metadata.rb
|
209
|
+
- lib/rdkafka/native_kafka.rb
|
211
210
|
- lib/rdkafka/producer.rb
|
212
|
-
- lib/rdkafka/producer/client.rb
|
213
211
|
- lib/rdkafka/producer/delivery_handle.rb
|
214
212
|
- lib/rdkafka/producer/delivery_report.rb
|
215
213
|
- lib/rdkafka/version.rb
|
@@ -222,13 +220,14 @@ files:
|
|
222
220
|
- spec/rdkafka/bindings_spec.rb
|
223
221
|
- spec/rdkafka/callbacks_spec.rb
|
224
222
|
- spec/rdkafka/config_spec.rb
|
223
|
+
- spec/rdkafka/consumer/headers_spec.rb
|
225
224
|
- spec/rdkafka/consumer/message_spec.rb
|
226
225
|
- spec/rdkafka/consumer/partition_spec.rb
|
227
226
|
- spec/rdkafka/consumer/topic_partition_list_spec.rb
|
228
227
|
- spec/rdkafka/consumer_spec.rb
|
229
228
|
- spec/rdkafka/error_spec.rb
|
230
229
|
- spec/rdkafka/metadata_spec.rb
|
231
|
-
- spec/rdkafka/
|
230
|
+
- spec/rdkafka/native_kafka_spec.rb
|
232
231
|
- spec/rdkafka/producer/delivery_handle_spec.rb
|
233
232
|
- spec/rdkafka/producer/delivery_report_spec.rb
|
234
233
|
- spec/rdkafka/producer_spec.rb
|
@@ -255,11 +254,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
255
254
|
version: '2.6'
|
256
255
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
257
256
|
requirements:
|
258
|
-
- - "
|
257
|
+
- - ">"
|
259
258
|
- !ruby/object:Gem::Version
|
260
|
-
version:
|
259
|
+
version: 1.3.1
|
261
260
|
requirements: []
|
262
|
-
rubygems_version: 3.
|
261
|
+
rubygems_version: 3.1.2
|
263
262
|
signing_key:
|
264
263
|
specification_version: 4
|
265
264
|
summary: The rdkafka gem is a modern Kafka client library for Ruby based on librdkafka.
|
@@ -275,13 +274,14 @@ test_files:
|
|
275
274
|
- spec/rdkafka/bindings_spec.rb
|
276
275
|
- spec/rdkafka/callbacks_spec.rb
|
277
276
|
- spec/rdkafka/config_spec.rb
|
277
|
+
- spec/rdkafka/consumer/headers_spec.rb
|
278
278
|
- spec/rdkafka/consumer/message_spec.rb
|
279
279
|
- spec/rdkafka/consumer/partition_spec.rb
|
280
280
|
- spec/rdkafka/consumer/topic_partition_list_spec.rb
|
281
281
|
- spec/rdkafka/consumer_spec.rb
|
282
282
|
- spec/rdkafka/error_spec.rb
|
283
283
|
- spec/rdkafka/metadata_spec.rb
|
284
|
-
- spec/rdkafka/
|
284
|
+
- spec/rdkafka/native_kafka_spec.rb
|
285
285
|
- spec/rdkafka/producer/delivery_handle_spec.rb
|
286
286
|
- spec/rdkafka/producer/delivery_report_spec.rb
|
287
287
|
- spec/rdkafka/producer_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/bin/console
DELETED
Binary file
|
@@ -1,47 +0,0 @@
|
|
1
|
-
module Rdkafka
|
2
|
-
class Producer
|
3
|
-
class Client
|
4
|
-
def initialize(native)
|
5
|
-
@native = native
|
6
|
-
|
7
|
-
# Start thread to poll client for delivery callbacks
|
8
|
-
@polling_thread = Thread.new do
|
9
|
-
loop do
|
10
|
-
Rdkafka::Bindings.rd_kafka_poll(native, 250)
|
11
|
-
# Exit thread if closing and the poll queue is empty
|
12
|
-
if Thread.current[:closing] && Rdkafka::Bindings.rd_kafka_outq_len(native) == 0
|
13
|
-
break
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
@polling_thread.abort_on_exception = true
|
18
|
-
@polling_thread[:closing] = false
|
19
|
-
end
|
20
|
-
|
21
|
-
def native
|
22
|
-
@native
|
23
|
-
end
|
24
|
-
|
25
|
-
def finalizer
|
26
|
-
->(_) { close }
|
27
|
-
end
|
28
|
-
|
29
|
-
def closed?
|
30
|
-
@native.nil?
|
31
|
-
end
|
32
|
-
|
33
|
-
def close(object_id=nil)
|
34
|
-
return unless @native
|
35
|
-
|
36
|
-
# Indicate to polling thread that we're closing
|
37
|
-
@polling_thread[:closing] = true
|
38
|
-
# Wait for the polling thread to finish up
|
39
|
-
@polling_thread.join
|
40
|
-
|
41
|
-
Rdkafka::Bindings.rd_kafka_destroy(@native)
|
42
|
-
|
43
|
-
@native = nil
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|