sbmt-kafka_consumer 3.2.2 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5a5ec88a0a62d524925444b52430e6d57331c2eb58dfff213b92b635353ea2f
4
- data.tar.gz: 50d8e0b6320c0cc22b70dcc12c0fb8670802786d8637a901de953f04cfc39b46
3
+ metadata.gz: 59edd9a2025974b834689fbccd4e9637c90b217a71a30da14515c99ce6ced9e4
4
+ data.tar.gz: cb08c1a44da7bf4a508ebeed15318d7ea0eb461482e997fe194b8f14141a1cd4
5
5
  SHA512:
6
- metadata.gz: 655cae48292b61cf07d6dd58acd9249ee2adbf4244ff74ec8a7674237619dd29832588c31bf9f6294c08fd3985de8c87bff9b0eb3145bce461461a06c8cd56f3
7
- data.tar.gz: a1395fe3c16faa385cba9d8924101217043993d824b1ac7d2a1a28f31fc19c824c1a252346d6957c6c271d6c6927b072afeaae4b27397b874812d22868077ac5
6
+ metadata.gz: ca488baebfdc131c41f9731e1aba206d19c000e657d5fd2b35b04bb0907d70a8f89195761b75076dfca26763f867e1ace2a2a20873db477950ea420151197932
7
+ data.tar.gz: 3581fe9beed1978490f1786b0b2c6fba3c4416a0b462e12e24e74871937f8c9bff53790f62d944724359dd732009befabd6e9fc410691ad739b92a3ebc59a9e4
data/CHANGELOG.md CHANGED
@@ -13,6 +13,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
13
 
14
14
  ### Fixed
15
15
 
16
+ ## [3.3.0] - 2024-09-30
17
+
18
+ ### Added
19
+
20
+ - inheritance of kafka settings for topic
21
+
22
+ ### Fixed
23
+
24
+ - support `karafka 2.4.12`
25
+ - properly report metrics for consumer offset lag when partition fetch assignment was lost
26
+
16
27
  ## [3.2.2] - 2024-09-23
17
28
 
18
29
  ### Fixed
@@ -57,7 +57,7 @@ class Sbmt::KafkaConsumer::ClientConfigurer
57
57
  manual_offset_management t.manual_offset_management
58
58
  consumer t.consumer.consumer_klass
59
59
  deserializer t.deserializer.instantiate if t.deserializer.klass.present?
60
- kafka t.kafka_options if t.kafka_options.present?
60
+ kafka t.kafka_options.merge(inherit: true) if t.kafka_options.present?
61
61
  end
62
62
  end
63
63
  end
@@ -165,6 +165,8 @@ module Sbmt
165
165
  offset_lag = partition_statistics["consumer_lag"]
166
166
  next if offset_lag == -1
167
167
 
168
+ next unless partition_owned?(partition_statistics)
169
+
168
170
  Yabeda.kafka_consumer.offset_lag
169
171
  .set({
170
172
  client: Karafka::App.config.client_id,
@@ -180,6 +182,13 @@ module Sbmt
180
182
  def time_elapsed_sec(event)
181
183
  (event.payload[:time] || 0) / 1000.0
182
184
  end
185
+
186
+ def partition_owned?(partition_statistics)
187
+ return false if partition_statistics["fetch_state"] == "stopped"
188
+ return false if partition_statistics["fetch_state"] == "none"
189
+
190
+ true
191
+ end
183
192
  end
184
193
  end
185
194
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sbmt
4
4
  module KafkaConsumer
5
- VERSION = "3.2.2"
5
+ VERSION = "3.3.0"
6
6
  end
7
7
  end
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  spec.add_dependency "rails", ">= 6.1"
35
35
  spec.add_dependency "zeitwerk", "~> 2.3"
36
- spec.add_dependency "karafka", "~> 2.4", "< 2.4.12"
36
+ spec.add_dependency "karafka", "~> 2.4"
37
37
  spec.add_dependency "yabeda", ">= 0.11"
38
38
  spec.add_dependency "anyway_config", ">= 2.4.0"
39
39
  spec.add_dependency "thor"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbmt-kafka_consumer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kuper Ruby-Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-25 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -45,9 +45,6 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.4'
48
- - - "<"
49
- - !ruby/object:Gem::Version
50
- version: 2.4.12
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
@@ -55,9 +52,6 @@ dependencies:
55
52
  - - "~>"
56
53
  - !ruby/object:Gem::Version
57
54
  version: '2.4'
58
- - - "<"
59
- - !ruby/object:Gem::Version
60
- version: 2.4.12
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: yabeda
63
57
  requirement: !ruby/object:Gem::Requirement