sbmt-kafka_consumer 2.6.1 → 2.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08fdb32c69e94b244084454a41b71743a059d11fa1ae35e564ca32a3ee87dafd'
4
- data.tar.gz: b3e4365734439f273a5e42ebe6135d53627afb22a375a0d7d557d38d13a70cd5
3
+ metadata.gz: 4db2a1a6eecab6ef429ef1591991a38e19d5996f1881f8e21e1382513ccd972b
4
+ data.tar.gz: 490e1c37ce5029efe299119cd7a879fbdb7e0ee3be8e1bc49f4c18a7ad0a0b4c
5
5
  SHA512:
6
- metadata.gz: 0744b29e11d89164bf95d0573990bf694cf3e1d09e3861402449d86f142701d2e3982fc7928bc903102bd832e03494960335df5208b3fb3d5a403f60cd9cd93a
7
- data.tar.gz: 30c0c560a036a1febcf5af0cd66c08dc25c04ec8b5973c8f58892589c16aed4b40ca9d0358d6340228f2b715ea025afc7e2debcb1b962db6c458095f0ab48c7f
6
+ metadata.gz: 11ab3951c1caa9cf2975199c4815838058c719038f77cdc8d563ef36248eebf312cf06e66d9b43058918f3042f88312144f36183f0cddfe882c3b9c03b5e5c8d
7
+ data.tar.gz: 5eedd592dd638ac22181e2bd5717e8ef63ca2e4b23cfa1c79c05c0fb3c1596586492eff32c3a5b1475ce997dd8f184e0e6e9024252922409fc3dee5d474e7d8b
data/CHANGELOG.md CHANGED
@@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
13
 
14
14
  ### Fixed
15
15
 
16
+ ## [2.7.0] - 2024-07-30
17
+
18
+ ### Changed
19
+
20
+ - When using strategy `cooperative-sticky`, method `mark_as_consumed` is used ([more details](https://github.com/karafka/karafka/wiki/FAQ#why-when-using-cooperative-sticky-rebalance-strategy-all-topics-get-revoked-on-rebalance))
21
+
16
22
  ## [2.6.1] - 2024-07-05
17
23
 
18
24
  ### Fixed
@@ -19,7 +19,7 @@ module Sbmt
19
19
  if process_batch?
20
20
  with_batch_instrumentation(messages) do
21
21
  process_batch(messages)
22
- mark_as_consumed!(messages.last)
22
+ mark_message(messages.last)
23
23
  end
24
24
  else
25
25
  messages.each do |message|
@@ -108,7 +108,7 @@ module Sbmt
108
108
  end
109
109
 
110
110
  with_common_instrumentation("mark_as_consumed", message) do
111
- mark_as_consumed!(message)
111
+ mark_message(message)
112
112
  end
113
113
  end
114
114
 
@@ -169,6 +169,22 @@ module Sbmt
169
169
  def trace_id
170
170
  @trace_id ||= SecureRandom.base58
171
171
  end
172
+
173
+ def config
174
+ @config ||= Sbmt::KafkaConsumer::Config.new
175
+ end
176
+
177
+ def cooperative_sticky?
178
+ config.partition_assignment_strategy == "cooperative-sticky"
179
+ end
180
+
181
+ def mark_message(message)
182
+ if cooperative_sticky?
183
+ mark_as_consumed(message)
184
+ else
185
+ mark_as_consumed!(message)
186
+ end
187
+ end
172
188
  end
173
189
  end
174
190
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sbmt
4
4
  module KafkaConsumer
5
- VERSION = "2.6.1"
5
+ VERSION = "2.7.0"
6
6
  end
7
7
  end
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: 2.6.1
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sbermarket Ruby-Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2024-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails