karafka 1.2.4 → 1.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76f863235897ae7dc92ee3d8353acb6cc3593cffe609dab00b70af78b4895d49
4
- data.tar.gz: 8aaa8ee35a193b16fd34029e44e9a4063255e765f236d8268b22d644fcde4675
3
+ metadata.gz: '06939706b6c75a4bb203d640074cdbfa830087928e45aac38ff46b6218ef6f39'
4
+ data.tar.gz: 0e3ab4c874945a66b2962d505bd7a9e6425e6b71d8e05dd3d39461835b1a9f23
5
5
  SHA512:
6
- metadata.gz: 26f5aa227da31b07612cd363bcdcccc4fec974061874fdd9878fd6afa9cd952a8901d83d19dfea9130f7c34e3704bb57b3e5d974b7875ad6c0027f50c7ab78ce
7
- data.tar.gz: 9bae8c9fc22f27d4e1713d269a37b490f3d461ca2b3fe6fdfda3ae2adebc69d284441860d33c0ceb7a67be7e215e05896da434cbaaebd069c25e4ca90865c7df
6
+ metadata.gz: 85ca37b034db8ac90a8843f1366528bb466055ea665e9108359c57ad6857283a5ae031ac9651ee22d4685a8af54ddfd3c450529a6de1170d51a4066b51e01dbb
7
+ data.tar.gz: 9caa2cc29e2dbd53889010feb014811229b890b06764cfa0081483040029c7dd8a7707c8c5ec0ec977559e5c00f7c0eeb0396376c47469be4e1d14390aa5b8f2
data/.gitignore CHANGED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 1.2.5 Unreleased
4
+ - #354 - Expose consumer heartbeat
5
+ - #373 - Async producer not working properly with responders
6
+
3
7
  ## 1.2.4
4
8
  - #332 - Fetcher for max queue size
5
9
 
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)
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.5.3)
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.6)
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.0)
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.5)
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.12.2)
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.2, >= 0.2.1)
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
- inflecto (~> 0.0.0, >= 0.0.2)
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.12.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.2)
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.3)
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.1
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.5.3'
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
- options[:async] ? WaterDrop::AsyncProducer : WaterDrop::SyncProducer
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.keys.include?(setting_name)
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 ? method_name : block
26
+ set_callback type, :before, method_name || block
27
27
  end
28
28
  end
29
29
  end
@@ -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
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '1.2.4'
6
+ VERSION = '1.2.5'
7
7
  end
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
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-05-11 00:00:00.000000000 Z
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.5.3
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.5.3
154
+ version: 0.6.4
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: thor
157
157
  requirement: !ruby/object:Gem::Requirement