karafka 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +0 -0
- data/Gemfile.lock +13 -15
- data/README.md +0 -0
- data/karafka.gemspec +1 -1
- data/lib/karafka/base_responder.rb +3 -1
- data/lib/karafka/connection/api_adapter.rb +1 -1
- data/lib/karafka/connection/client.rb +6 -0
- data/lib/karafka/consumers/callbacks.rb +1 -1
- data/lib/karafka/setup/config.rb +3 -3
- data/lib/karafka/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '06939706b6c75a4bb203d640074cdbfa830087928e45aac38ff46b6218ef6f39'
|
4
|
+
data.tar.gz: 0e3ab4c874945a66b2962d505bd7a9e6425e6b71d8e05dd3d39461835b1a9f23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85ca37b034db8ac90a8843f1366528bb466055ea665e9108359c57ad6857283a5ae031ac9651ee22d4685a8af54ddfd3c450529a6de1170d51a4066b51e01dbb
|
7
|
+
data.tar.gz: 9caa2cc29e2dbd53889010feb014811229b890b06764cfa0081483040029c7dd8a7707c8c5ec0ec977559e5c00f7c0eeb0396376c47469be4e1d14390aa5b8f2
|
data/.gitignore
CHANGED
File without changes
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
File without changes
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
karafka (1.2.
|
4
|
+
karafka (1.2.5)
|
5
5
|
activesupport (>= 4.0)
|
6
6
|
dry-configurable (~> 0.7)
|
7
7
|
dry-inflector (~> 0.1.1)
|
@@ -11,7 +11,7 @@ PATH
|
|
11
11
|
multi_json (>= 1.12)
|
12
12
|
rake (>= 11.3)
|
13
13
|
require_all (>= 1.4)
|
14
|
-
ruby-kafka (>= 0.
|
14
|
+
ruby-kafka (>= 0.6.4)
|
15
15
|
thor (~> 0.19)
|
16
16
|
waterdrop (~> 1.2)
|
17
17
|
|
@@ -25,17 +25,17 @@ GEM
|
|
25
25
|
tzinfo (~> 1.1)
|
26
26
|
benchmark-ips (2.7.2)
|
27
27
|
concurrent-ruby (1.0.5)
|
28
|
-
delivery_boy (0.2.
|
28
|
+
delivery_boy (0.2.7)
|
29
29
|
king_konf (~> 0.2)
|
30
30
|
ruby-kafka (~> 0.5)
|
31
31
|
diff-lcs (1.3)
|
32
|
-
docile (1.3.
|
32
|
+
docile (1.3.1)
|
33
33
|
dry-configurable (0.7.0)
|
34
34
|
concurrent-ruby (~> 1.0)
|
35
35
|
dry-container (0.6.0)
|
36
36
|
concurrent-ruby (~> 1.0)
|
37
37
|
dry-configurable (~> 0.1, >= 0.1.3)
|
38
|
-
dry-core (0.4.
|
38
|
+
dry-core (0.4.7)
|
39
39
|
concurrent-ruby (~> 1.0)
|
40
40
|
dry-equalizer (0.2.1)
|
41
41
|
dry-events (0.1.0)
|
@@ -52,28 +52,26 @@ GEM
|
|
52
52
|
dry-equalizer (~> 0.2)
|
53
53
|
dry-events (~> 0.1)
|
54
54
|
rouge (~> 2.0, >= 2.2.1)
|
55
|
-
dry-types (0.
|
55
|
+
dry-types (0.13.2)
|
56
56
|
concurrent-ruby (~> 1.0)
|
57
|
-
dry-configurable (~> 0.1)
|
58
57
|
dry-container (~> 0.3)
|
59
|
-
dry-core (~> 0.
|
58
|
+
dry-core (~> 0.4, >= 0.4.4)
|
60
59
|
dry-equalizer (~> 0.2)
|
60
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
61
61
|
dry-logic (~> 0.4, >= 0.4.2)
|
62
|
-
|
63
|
-
dry-validation (0.11.1)
|
62
|
+
dry-validation (0.12.1)
|
64
63
|
concurrent-ruby (~> 1.0)
|
65
64
|
dry-configurable (~> 0.1, >= 0.1.3)
|
66
65
|
dry-core (~> 0.2, >= 0.2.1)
|
67
66
|
dry-equalizer (~> 0.2)
|
68
67
|
dry-logic (~> 0.4, >= 0.4.0)
|
69
|
-
dry-types (~> 0.
|
68
|
+
dry-types (~> 0.13.1)
|
70
69
|
envlogic (1.1.0)
|
71
70
|
dry-inflector (~> 0.1)
|
72
71
|
i18n (1.0.1)
|
73
72
|
concurrent-ruby (~> 1.0)
|
74
|
-
inflecto (0.0.2)
|
75
73
|
json (2.1.0)
|
76
|
-
king_konf (0.3.
|
74
|
+
king_konf (0.3.6)
|
77
75
|
minitest (5.11.3)
|
78
76
|
multi_json (1.13.1)
|
79
77
|
null-logger (0.1.5)
|
@@ -93,7 +91,7 @@ GEM
|
|
93
91
|
diff-lcs (>= 1.2.0, < 2.0)
|
94
92
|
rspec-support (~> 3.7.0)
|
95
93
|
rspec-support (3.7.1)
|
96
|
-
ruby-kafka (0.6.
|
94
|
+
ruby-kafka (0.6.7)
|
97
95
|
simplecov (0.16.1)
|
98
96
|
docile (~> 1.1)
|
99
97
|
json (>= 1.8, < 3)
|
@@ -122,4 +120,4 @@ DEPENDENCIES
|
|
122
120
|
timecop
|
123
121
|
|
124
122
|
BUNDLED WITH
|
125
|
-
1.16.
|
123
|
+
1.16.3
|
data/README.md
CHANGED
File without changes
|
data/karafka.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_dependency 'multi_json', '>= 1.12'
|
26
26
|
spec.add_dependency 'rake', '>= 11.3'
|
27
27
|
spec.add_dependency 'require_all', '>= 1.4'
|
28
|
-
spec.add_dependency 'ruby-kafka', '>= 0.
|
28
|
+
spec.add_dependency 'ruby-kafka', '>= 0.6.4'
|
29
29
|
spec.add_dependency 'thor', '~> 0.19'
|
30
30
|
spec.add_dependency 'waterdrop', '~> 1.2'
|
31
31
|
|
@@ -198,7 +198,9 @@ module Karafka
|
|
198
198
|
# @param options [Hash] options for waterdrop
|
199
199
|
# @return [Class] WaterDrop producer (sync or async based on the settings)
|
200
200
|
def producer(options)
|
201
|
-
|
201
|
+
self.class.topics[
|
202
|
+
options[:topic]
|
203
|
+
].async? ? WaterDrop::AsyncProducer : WaterDrop::SyncProducer
|
202
204
|
end
|
203
205
|
end
|
204
206
|
end
|
@@ -121,7 +121,7 @@ module Karafka
|
|
121
121
|
next unless AttributesMap.api_adapter[namespace_key].include?(setting_name)
|
122
122
|
# Ignore settings that are already initialized
|
123
123
|
# In case they are in preexisting settings fetched differently
|
124
|
-
next if preexisting_settings.
|
124
|
+
next if preexisting_settings.key?(setting_name)
|
125
125
|
# Fetch all the settings from a given layer object. Objects can handle the fallback
|
126
126
|
# to the kafka settings, so
|
127
127
|
preexisting_settings[setting_name] = route_layer.send(setting_name)
|
@@ -82,6 +82,12 @@ module Karafka
|
|
82
82
|
kafka_consumer.commit_offsets
|
83
83
|
end
|
84
84
|
|
85
|
+
# Triggers a non-optional blocking heartbeat that notifies Kafka about the fact, that this
|
86
|
+
# consumer / client is still up and running
|
87
|
+
def trigger_heartbeat
|
88
|
+
kafka_consumer.trigger_heartbeat!
|
89
|
+
end
|
90
|
+
|
85
91
|
private
|
86
92
|
|
87
93
|
attr_reader :consumer_group
|
@@ -23,7 +23,7 @@ module Karafka
|
|
23
23
|
# @param method_name [Symbol, String] method name or nil if we plan to provide a block
|
24
24
|
# @yield A block with a code that should be executed before scheduling
|
25
25
|
define_method type do |method_name = nil, &block|
|
26
|
-
set_callback type, :before, method_name
|
26
|
+
set_callback type, :before, method_name || block
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
data/lib/karafka/setup/config.rb
CHANGED
@@ -69,14 +69,14 @@ module Karafka
|
|
69
69
|
setting :seed_brokers
|
70
70
|
# option session_timeout [Integer] the number of seconds after which, if a client
|
71
71
|
# hasn't contacted the Kafka cluster, it will be kicked out of the group.
|
72
|
-
setting :pause_timeout, 10
|
73
|
-
# option offset_commit_interval [Integer] the interval between offset commits,
|
74
|
-
# in seconds.
|
75
72
|
setting :session_timeout, 30
|
76
73
|
# Time that a given partition will be paused from fetching messages, when message
|
77
74
|
# consumption fails. It allows us to process other partitions, while the error is being
|
78
75
|
# resolved and also "slows" things down, so it prevents from "eating" up all messages and
|
79
76
|
# consuming them with failed code. Use `nil` if you want to pause forever and never retry.
|
77
|
+
setting :pause_timeout, 10
|
78
|
+
# option offset_commit_interval [Integer] the interval between offset commits,
|
79
|
+
# in seconds.
|
80
80
|
setting :offset_commit_interval, 10
|
81
81
|
# option offset_commit_threshold [Integer] the number of messages that can be
|
82
82
|
# processed before their offsets are committed. If zero, offset commits are
|
data/lib/karafka/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-07-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -144,14 +144,14 @@ dependencies:
|
|
144
144
|
requirements:
|
145
145
|
- - ">="
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
version: 0.
|
147
|
+
version: 0.6.4
|
148
148
|
type: :runtime
|
149
149
|
prerelease: false
|
150
150
|
version_requirements: !ruby/object:Gem::Requirement
|
151
151
|
requirements:
|
152
152
|
- - ">="
|
153
153
|
- !ruby/object:Gem::Version
|
154
|
-
version: 0.
|
154
|
+
version: 0.6.4
|
155
155
|
- !ruby/object:Gem::Dependency
|
156
156
|
name: thor
|
157
157
|
requirement: !ruby/object:Gem::Requirement
|