kafka 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -0
- data/examples/producer.rb +0 -1
- data/kafka.gemspec +8 -4
- data/lib/kafka/consumer.rb +3 -3
- data/lib/kafka/producer/delivery_report.rb +13 -0
- data/lib/kafka/version.rb +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6970af4b6ef931eb091068ee75220a2ce7a3f79a3afa7abd0dc40c9b6f88a18
|
4
|
+
data.tar.gz: cdda5ed68a3f9310fe6ce33930d3ebff71f5d9c53b735c2412e6a72fce9ba546
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cd6d75ccbb42e8d37d763f542c5c267fae092bb26558057f2f3b04de92d27021b4a57361ccf12ea40a8ebfcc234a651b27c71341ecb57327e9cbd32c486105f
|
7
|
+
data.tar.gz: 7cc3f4d3b70f11b20af2ed8d6fce065d8abdf5a53c5ab60bb39cfbb59c1a306b6eb876337bc2b7370bd83377934942e24868c46db5b511766a5f7296f2bea7bf
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Kafka
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.com/deadmanssnitch/kafka.svg?branch=master)](https://travis-ci.com/deadmanssnitch/kafka)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/kafka.svg)](https://badge.fury.io/rb/kafka)
|
4
5
|
|
5
6
|
The kafka gem provides a general producer and consumer for
|
6
7
|
[Apache Kafka](https://kafka.apache.org) using bindings to the official
|
data/examples/producer.rb
CHANGED
data/kafka.gemspec
CHANGED
@@ -14,13 +14,17 @@ Gem::Specification.new do |spec|
|
|
14
14
|
consumer implementation.
|
15
15
|
DESCRIPTION
|
16
16
|
|
17
|
-
spec.homepage = "
|
17
|
+
spec.homepage = "https://deadmanssnitch.com/opensource/kafka"
|
18
18
|
spec.license = "MIT"
|
19
19
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
20
20
|
|
21
|
-
spec.metadata
|
22
|
-
|
23
|
-
|
21
|
+
spec.metadata = {
|
22
|
+
"homepage_uri" => spec.homepage,
|
23
|
+
"bug_tracker_uri" => "https://github.com/deadmanssnitch/kafka/issues",
|
24
|
+
"source_code_uri" => "https://github.com/deadmanssnitch/kafka",
|
25
|
+
"documentation_uri" => "https://deadmanssnitch.com/opensource/kafka/docs/",
|
26
|
+
"changelog_uri" => "https://github.com/deadmanssnitch/kafka/blob/master/CHANGELOG.md",
|
27
|
+
}
|
24
28
|
|
25
29
|
# Specify which files should be added to the gem when it is released.
|
26
30
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/kafka/consumer.rb
CHANGED
@@ -18,8 +18,9 @@ module Kafka
|
|
18
18
|
# Initialize the client
|
19
19
|
@client = Kafka::FFI::Consumer.new(config)
|
20
20
|
|
21
|
-
#
|
22
|
-
|
21
|
+
# Redirect the main event queue so calls to consumer_poll will fire
|
22
|
+
# callbacks instead of having to have a separate poller thread.
|
23
|
+
@client.poll_set_consumer
|
23
24
|
end
|
24
25
|
|
25
26
|
# Subscribe the consumer to the given list of topics. Once the
|
@@ -71,7 +72,6 @@ module Kafka
|
|
71
72
|
# Consumer.
|
72
73
|
def close
|
73
74
|
# @see https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md#high-level-kafkaconsumer
|
74
|
-
@poller.stop
|
75
75
|
|
76
76
|
# Gracefully shutdown the consumer, leaving the consumer group,
|
77
77
|
# committing any remaining offsets, and releasing resources back to the
|
@@ -19,6 +19,17 @@ class Kafka::Producer
|
|
19
19
|
# @return [Integer] Partition the message was delivered to.
|
20
20
|
attr_reader :partition
|
21
21
|
|
22
|
+
# Returns the number of microseconds since the message was enqueued for
|
23
|
+
# delivery until the message was confirmed by the cluster or permanently
|
24
|
+
# failed.
|
25
|
+
#
|
26
|
+
# @note Latency is in microseconds (μs) while most other timestamps are in
|
27
|
+
# milliseconds.
|
28
|
+
#
|
29
|
+
# @return [nil] Latency was not available
|
30
|
+
# @return [Integer] Time since message was produced in microseconds
|
31
|
+
attr_reader :latency
|
32
|
+
|
22
33
|
# Initializes a new DeliveryReport
|
23
34
|
#
|
24
35
|
# @param block [Proc] Callback to call with the DeliveryReport when it is
|
@@ -30,6 +41,7 @@ class Kafka::Producer
|
|
30
41
|
@error = nil
|
31
42
|
@topic = nil
|
32
43
|
@offset = nil
|
44
|
+
@latency = nil
|
33
45
|
@partition = nil
|
34
46
|
@callback = block
|
35
47
|
|
@@ -73,6 +85,7 @@ class Kafka::Producer
|
|
73
85
|
@offset = message.offset
|
74
86
|
@topic = message.topic
|
75
87
|
@partition = message.partition
|
88
|
+
@latency = message.latency
|
76
89
|
|
77
90
|
@done = true
|
78
91
|
@waiter.broadcast
|
data/lib/kafka/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Gaffney
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -130,12 +130,14 @@ files:
|
|
130
130
|
- lib/kafka/producer.rb
|
131
131
|
- lib/kafka/producer/delivery_report.rb
|
132
132
|
- lib/kafka/version.rb
|
133
|
-
homepage:
|
133
|
+
homepage: https://deadmanssnitch.com/opensource/kafka
|
134
134
|
licenses:
|
135
135
|
- MIT
|
136
136
|
metadata:
|
137
|
-
homepage_uri:
|
138
|
-
|
137
|
+
homepage_uri: https://deadmanssnitch.com/opensource/kafka
|
138
|
+
bug_tracker_uri: https://github.com/deadmanssnitch/kafka/issues
|
139
|
+
source_code_uri: https://github.com/deadmanssnitch/kafka
|
140
|
+
documentation_uri: https://deadmanssnitch.com/opensource/kafka/docs/
|
139
141
|
changelog_uri: https://github.com/deadmanssnitch/kafka/blob/master/CHANGELOG.md
|
140
142
|
post_install_message:
|
141
143
|
rdoc_options: []
|