kafkr 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/kafkr-consumer +2 -0
- data/lib/kafkr/consumer.rb +4 -1
- data/lib/kafkr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41bbdf52172942afa5cb0758bee83eeb452f74f3d61849841fe186e44ef323a5
|
4
|
+
data.tar.gz: fcf59de6aed2bc3644df69573091dbffeb9641f39bb5fbdece548de3cf509217
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f249925d3d2de4ca159796d88628450b78fdb5d5c00c756891202d39f7d8e34b69f282613c819c2aecc734a7fc0fe0c414ea2471955c27dda394e9f27bca1d5
|
7
|
+
data.tar.gz: 8e004710cfffe4ead0df8ed181fa5f8d044ca4cb8690d6be92028473475a9b2fddea89f0c8f77fbf96ea8b3eeaa00886a8e7ec94eff338379c9797cfa8956bf7
|
data/exe/kafkr-consumer
CHANGED
@@ -7,6 +7,7 @@ require "digest"
|
|
7
7
|
# Accepting command line arguments for host and port
|
8
8
|
host = ARGV[0] || "localhost"
|
9
9
|
port = ARGV[1] || 4000
|
10
|
+
timeout = ARGV[2] || 120
|
10
11
|
|
11
12
|
puts "Running on host: #{host} and port: #{port}"
|
12
13
|
|
@@ -40,6 +41,7 @@ def start_consumer(port, host)
|
|
40
41
|
Kafkr::Consumer.configure do |config|
|
41
42
|
config.port = port
|
42
43
|
config.host = host
|
44
|
+
config.timeout = timeout
|
43
45
|
end
|
44
46
|
|
45
47
|
unless $handlers_loaded
|
data/lib/kafkr/consumer.rb
CHANGED
@@ -18,6 +18,9 @@ module Kafkr
|
|
18
18
|
def configuration
|
19
19
|
FileUtils.mkdir_p "./.kafkr"
|
20
20
|
@configuration ||= OpenStruct.new
|
21
|
+
@configuration.host = ENV.fetch("KAFKR_HOST", "localhost")
|
22
|
+
@configuration.port = ENV.fetch("KAFKR_PORT", 2000)
|
23
|
+
@configuration.timeout = ENV.fetch("KAFKR_CONSUMER_TIMEOUT", 120)
|
21
24
|
@configuration.suggest_handlers = false
|
22
25
|
@configuration
|
23
26
|
end
|
@@ -150,7 +153,7 @@ module Kafkr
|
|
150
153
|
socket = TCPSocket.new(@host, @port)
|
151
154
|
attempt = 0
|
152
155
|
|
153
|
-
Timeout.timeout(
|
156
|
+
Timeout.timeout(Kafkr::Consumer.configuration.timeout) do
|
154
157
|
sync_uid = send_message.call(message)
|
155
158
|
|
156
159
|
loop do
|
data/lib/kafkr/version.rb
CHANGED