racecar 2.10.0 → 2.11.0.beta1

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: f3f3ca0f465510fef5659a765dc90bc1902522b2793fa2f6af03e0be23f93f93
4
- data.tar.gz: 149a2ce49346b0a98e120d00814025fa812526fc912998b715fe5c17cd27a6c8
3
+ metadata.gz: 48e769353ddc8eb277f9f167804e610b2b806a46472f5ee44637a0b7ecca37d9
4
+ data.tar.gz: 27958f39d445e0217636d6b8f678f8872f583f9d24b84c682a1609b2ccddd4cf
5
5
  SHA512:
6
- metadata.gz: 4ded7458c65547b3d81f4027fb2472354434661912a2bea329a3014eb2dedfe946553ba79c190c5a4e45d33774a0fdae62f120e83cff7ebb8917a70e743a381b
7
- data.tar.gz: 577bbfc015b1f087ad0fe10deb6e710470526b8bb498341eb202a702fefe45c57c123530e64ca5647cfb77e9178967acb72cd1cbea3cb15cbe721e0956807bf5
6
+ metadata.gz: 85522feb8f5bcdd3a3a31fa9d661892e75c3e2d4c6b27795e0ba807bbed60c5a27a3d7613f5dbc5c00b05dc80ba8a25504ec78602e35b67e7de815f28bcee38f
7
+ data.tar.gz: 1cbff8134c615a61ba6ee04cc64c87b405e5fa85c618b666df1ccec57a11526627502368a8f91d759798553169bbc935cb9a1349e4c79010fc5713e4475ec423
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.11.0.beta1
6
+
7
+ * Configurable strategy for consuming multiple topics
8
+
5
9
  ## 2.10.0
6
10
 
7
11
  * Bump rdkafka gem version to 0.13.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- racecar (2.10.0)
4
+ racecar (2.11.0.beta1)
5
5
  king_konf (~> 1.0.0)
6
6
  rdkafka (~> 0.13.0)
7
7
 
@@ -185,6 +185,9 @@ module Racecar
185
185
  desc "Used only by the liveness probe: Max time (in seconds) between liveness events before the process is considered not healthy"
186
186
  integer :liveness_probe_max_interval, default: 5
187
187
 
188
+ desc "Strategy for switching topics when there are multiple subscriptions. `exhaust-topic` will only switch when the consumer poll returns no messages. `round-robin` will switch after each poll regardless.\nWarning: `round-robin` will be the default in Racecar 3.x"
189
+ string :multi_subscription_strategy, allowed_values: %w(round-robin exhaust-topic), default: "exhaust-topic"
190
+
188
191
  # The error handler must be set directly on the object.
189
192
  attr_reader :error_handler
190
193
 
@@ -175,6 +175,7 @@ module Racecar
175
175
 
176
176
  # polls a message for the current consumer, handling any API edge cases.
177
177
  def poll_current_consumer(max_wait_time_ms)
178
+ @last_poll_read_nil_message = false
178
179
  msg = current.poll(max_wait_time_ms)
179
180
  rescue Rdkafka::RdkafkaError => e
180
181
  case e.code
@@ -212,9 +213,14 @@ module Racecar
212
213
  end
213
214
 
214
215
  def maybe_select_next_consumer
215
- return unless @last_poll_read_nil_message
216
- @last_poll_read_nil_message = false
217
- select_next_consumer
216
+ case @config.multi_subscription_strategy
217
+ when "round-robin"
218
+ select_next_consumer
219
+ else # "exhaust-topic"
220
+ if @last_poll_read_nil_message
221
+ select_next_consumer
222
+ end
223
+ end
218
224
  end
219
225
 
220
226
  def select_next_consumer
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Racecar
4
- VERSION = "2.10.0"
4
+ VERSION = "2.11.0.beta1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racecar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 2.11.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-01-09 00:00:00.000000000 Z
12
+ date: 2024-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: king_konf
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  requirements: []
232
- rubygems_version: 3.0.3.1
232
+ rubygems_version: 3.5.3
233
233
  signing_key:
234
234
  specification_version: 4
235
235
  summary: A framework for running Kafka consumers