racecar 2.10.0.beta2 → 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: 2277b7e88416d37c97f2467738360dcd92a52ea680a24e7a2aa6610883297917
4
- data.tar.gz: fbd34f82fe0f4b75b4e1672073e8b92cd7f9b211b8361e6469af496aa9e6b338
3
+ metadata.gz: 48e769353ddc8eb277f9f167804e610b2b806a46472f5ee44637a0b7ecca37d9
4
+ data.tar.gz: 27958f39d445e0217636d6b8f678f8872f583f9d24b84c682a1609b2ccddd4cf
5
5
  SHA512:
6
- metadata.gz: 6506e65b5380e1dbb71c91ece7065274f36c6f1afe880e529f9e811bd1c5dcb4ac0c81728194b07a92e4b125c0731d2d3a896bb61239d7a5977d33351ebaed4b
7
- data.tar.gz: f4d19863c9cd0012a5542574d2f1c3b95a5dd8916a6176a6aff83712098da633b3fe43df4ef8c4e74ce2939510d169cbdf9fa4b58bdedcc8a8e686371cfd1b8b
6
+ metadata.gz: 85522feb8f5bcdd3a3a31fa9d661892e75c3e2d4c6b27795e0ba807bbed60c5a27a3d7613f5dbc5c00b05dc80ba8a25504ec78602e35b67e7de815f28bcee38f
7
+ data.tar.gz: 1cbff8134c615a61ba6ee04cc64c87b405e5fa85c618b666df1ccec57a11526627502368a8f91d759798553169bbc935cb9a1349e4c79010fc5713e4475ec423
@@ -17,12 +17,12 @@ jobs:
17
17
  - "3.0"
18
18
  - "3.1"
19
19
  - "3.2"
20
- - "3.3.0-preview2"
20
+ - "3.3"
21
21
 
22
22
  steps:
23
- - uses: zendesk/checkout@v3
23
+ - uses: actions/checkout@v4
24
24
  - name: Set up Ruby
25
- uses: zendesk/setup-ruby@v1
25
+ uses: ruby/setup-ruby@v1
26
26
  with:
27
27
  ruby-version: ${{ matrix.ruby-version }}
28
28
  bundler-cache: true
@@ -32,9 +32,9 @@ jobs:
32
32
  integration-specs:
33
33
  runs-on: ubuntu-latest
34
34
  steps:
35
- - uses: zendesk/checkout@v3
35
+ - uses: actions/checkout@v4
36
36
  - name: Set up Ruby
37
- uses: zendesk/setup-ruby@v1
37
+ uses: ruby/setup-ruby@v1
38
38
  with:
39
39
  ruby-version: "2.7"
40
40
  bundler-cache: true
data/CHANGELOG.md CHANGED
@@ -2,21 +2,21 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- ## 2.10.0.beta2
5
+ ## 2.11.0.beta1
6
6
 
7
- * Don't load rails env for liveness probe
8
- * Resolve Rails 7.1 logger incompatibility
9
- * Test with Ruby 3.3 preview
7
+ * Configurable strategy for consuming multiple topics
10
8
 
11
- ## 2.10.0.beta1
9
+ ## 2.10.0
12
10
 
13
11
  * Bump rdkafka gem version to 0.13.0
14
12
  * Support cooperative-sticky
15
13
  * Instrument produce delivery errors
14
+ * Resolve Rails 7.1 logger incompatibility
15
+ * Don't load rails env for liveness probe
16
16
  * Fix config load for liveness probe
17
17
  * Send exceptions to `process_batch` instrumenter
18
18
  * Docker test fixes
19
- * Test with Ruby 3.2
19
+ * Test in CI with Ruby 3.2
20
20
 
21
21
  ## v2.9.0, v2.9.0.beta1
22
22
 
@@ -26,7 +26,7 @@
26
26
  * Add built-in liveness probe for Kubernetes deployments.
27
27
 
28
28
  ## v2.8.2
29
- * Handles ErroneousStateError, in previous versions the consumer would do several unecessary group leave/joins. The log level is also changed to WARN instead of ERROR. ([#295](https://github.com/zendesk/racecar/pull/295))
29
+ * Handles ErroneousStateError, in previous versions the consumer would do several unnecessary group leave/joins. The log level is also changed to WARN instead of ERROR. ([#295](https://github.com/zendesk/racecar/pull/295))
30
30
 
31
31
  ## v2.8.1
32
32
  * Adds new ErroneousStateError to racecar in order to give more information on this new possible exception.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- racecar (2.10.0.beta2)
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.beta2"
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.beta2
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: 2023-10-18 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
@@ -225,11 +225,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
225
225
  version: '2.6'
226
226
  required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  requirements:
228
- - - ">"
228
+ - - ">="
229
229
  - !ruby/object:Gem::Version
230
- version: 1.3.1
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