sbmt-kafka_consumer 2.6.1 → 2.7.1

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: '08fdb32c69e94b244084454a41b71743a059d11fa1ae35e564ca32a3ee87dafd'
4
- data.tar.gz: b3e4365734439f273a5e42ebe6135d53627afb22a375a0d7d557d38d13a70cd5
3
+ metadata.gz: 8d08a056092306a4834b63b1fe86534f25e949839469e13f38aade18974939c9
4
+ data.tar.gz: cdf36647d564ac2d84fb06e4ca4e317d9e8dadb50a800a6f291de1a562ccc43a
5
5
  SHA512:
6
- metadata.gz: 0744b29e11d89164bf95d0573990bf694cf3e1d09e3861402449d86f142701d2e3982fc7928bc903102bd832e03494960335df5208b3fb3d5a403f60cd9cd93a
7
- data.tar.gz: 30c0c560a036a1febcf5af0cd66c08dc25c04ec8b5973c8f58892589c16aed4b40ca9d0358d6340228f2b715ea025afc7e2debcb1b962db6c458095f0ab48c7f
6
+ metadata.gz: 4877508c1f2c51e4ccbfb7dab086af8deb19c122039c93ee1e7552370e9c12f02765b9459b9c6119a7fa5d7766742913116896a67ad1423ae38f896026fad109
7
+ data.tar.gz: c1664eff5a8a4a58f5f342f8aabfd825c74268d89999ea5924aede943b0c31eee952ef4012ef7c15b5810cc6d3d847218d59fbb11339db90110aebf53838d1e8
data/CHANGELOG.md CHANGED
@@ -13,6 +13,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
13
 
14
14
  ### Fixed
15
15
 
16
+ ## [2.7.1] - 2024-08-01
17
+
18
+ ### Fixed
19
+
20
+ - Add mock `mark_as_consumed` for tests
21
+
22
+ ## [2.7.0] - 2024-07-30
23
+
24
+ ### Changed
25
+
26
+ - 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))
27
+
16
28
  ## [2.6.1] - 2024-07-05
17
29
 
18
30
  ### 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
@@ -24,6 +24,7 @@ RSpec.shared_context "with sbmt karafka consumer" do
24
24
  Sbmt::KafkaConsumer::ClientConfigurer.configure!
25
25
  allow(kafka_client).to receive(:assignment_lost?).and_return(false)
26
26
  allow(kafka_client).to receive(:mark_as_consumed!).and_return(true)
27
+ allow(kafka_client).to receive(:mark_as_consumed).and_return(true)
27
28
  }
28
29
 
29
30
  def publish_to_sbmt_karafka(raw_payload, opts = {})
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sbmt
4
4
  module KafkaConsumer
5
- VERSION = "2.6.1"
5
+ VERSION = "2.7.1"
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.1
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