racecar 0.4.0 → 0.4.1

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: 76a6192bd54678ebddbe84a29ab8f1cb8fdc3f40d30f1732bb9426eb28fa14d7
4
- data.tar.gz: af3bfc779898a1ccbd7ff862029e3b2c988fa6d07f58648e4b0d22ea8fb7752d
3
+ metadata.gz: 03f0ef60cb9d16c40adc14765b5fe497b1a1ee5384e7c63d4941373a618c5b52
4
+ data.tar.gz: 8551c7ec9b838ca3df774afb9f5e886957b3ac7ae3d88f63fc64b084aee03e9a
5
5
  SHA512:
6
- metadata.gz: 4ea1522b70bb40ef6f0cda810bf0c214bcc3f85a28945f3d47e0bbf443824ea5b5cddffe1e4fd5f948dc999ddf2350425404fe586716d1cc5ce74bbf4adfc29d
7
- data.tar.gz: 4af6a0eb25673036ae79f23b01bab4ac641aa2f57dbad33e6ed63bdb47ca1657135770ca7d9a52a7efd12b880e7c2b27bdfa05379c14345a5c9301e6f5c0e9e7
6
+ metadata.gz: afc4e4df8135bb55c109213ba09bd05c258ceccfb7674530a8ca9a670cee6bbb962bd3994d73682257a2ea530d7a8727b2b20c4a33e2ac5dbe229783768302a6
7
+ data.tar.gz: 3228f755bab3981835922c4dd47f3d25c65b258ff1fd612b9d752f7360bcb2f0613b9d3d455aeed66f45f39d7ce5ca2fd4732e8e116c4e61b26a9a25f2ab0b76
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## racecar v0.4.1
6
+
7
+ * Allow configuring the producer (#77).
8
+ * Add support for configuring exponential pause backoff (#76).
9
+
5
10
  ## racecar v0.4.0
6
11
 
7
12
  * Require Kafka 0.10 or higher.
@@ -25,6 +25,12 @@ module Racecar
25
25
  desc "How long to pause a partition for if the consumer raises an exception while processing a message -- set to -1 to pause indefinitely"
26
26
  float :pause_timeout, default: 10
27
27
 
28
+ desc "When `pause_timeout` and `pause_with_exponential_backoff` are configured, this sets an upper limit on the pause duration"
29
+ float :max_pause_timeout, default: nil
30
+
31
+ desc "Whether to exponentially increase the pause timeout on successive errors -- the timeout is doubled each time"
32
+ boolean :pause_with_exponential_backoff, default: false
33
+
28
34
  desc "The idle timeout after which a consumer is kicked out of the group"
29
35
  float :session_timeout, default: 30
30
36
 
@@ -91,6 +97,9 @@ module Racecar
91
97
  desc "Run the Racecar process in the background as a daemon"
92
98
  boolean :daemonize, default: false
93
99
 
100
+ desc "The codec used to compress messages with"
101
+ symbol :producer_compression_codec
102
+
94
103
  desc "Enable Datadog metrics"
95
104
  boolean :datadog_enabled, default: false
96
105
 
@@ -58,7 +58,10 @@ module Racecar
58
58
  end
59
59
 
60
60
  # Configure the consumer with a producer so it can produce messages.
61
- producer = kafka.producer
61
+ producer = kafka.producer(
62
+ compression_codec: config.producer_compression_codec,
63
+ )
64
+
62
65
  processor.configure(producer: producer)
63
66
 
64
67
  begin
@@ -71,10 +74,6 @@ module Racecar
71
74
  offset: message.offset,
72
75
  }
73
76
 
74
- # Allow subscribers to receive a notification *before* we process the
75
- # message.
76
- @instrumenter.instrument("start_process_message.racecar", payload)
77
-
78
77
  @instrumenter.instrument("process_message.racecar", payload) do
79
78
  processor.process(message)
80
79
  producer.deliver_messages
@@ -90,10 +89,6 @@ module Racecar
90
89
  message_count: batch.messages.count,
91
90
  }
92
91
 
93
- # Allow subscribers to receive a notification *before* we process the
94
- # message.
95
- @instrumenter.instrument("start_process_batch.racecar", payload)
96
-
97
92
  @instrumenter.instrument("process_batch.racecar", payload) do
98
93
  processor.process_batch(batch)
99
94
  producer.deliver_messages
@@ -110,7 +105,13 @@ module Racecar
110
105
  # The partition is automatically resumed after the specified timeout, and will continue where we
111
106
  # left off.
112
107
  @logger.warn "Pausing partition #{e.topic}/#{e.partition} for #{config.pause_timeout} seconds"
113
- consumer.pause(e.topic, e.partition, timeout: config.pause_timeout)
108
+ consumer.pause(
109
+ e.topic,
110
+ e.partition,
111
+ timeout: config.pause_timeout,
112
+ max_timeout: config.max_pause_timeout,
113
+ exponential_backoff: config.pause_with_exponential_backoff?,
114
+ )
114
115
  elsif config.pause_timeout == -1
115
116
  # A pause timeout of -1 means indefinite pausing, which in ruby-kafka is done by passing nil as
116
117
  # the timeout.
@@ -1,3 +1,3 @@
1
1
  module Racecar
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_runtime_dependency "king_konf", "~> 0.2.0"
24
- spec.add_runtime_dependency "ruby-kafka", "~> 0.5"
23
+ spec.add_runtime_dependency "king_konf", "~> 0.3.0"
24
+ spec.add_runtime_dependency "ruby-kafka", "~> 0.6"
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.13"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
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: 0.4.0
4
+ version: 0.4.1
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: 2018-04-18 00:00:00.000000000 Z
12
+ date: 2018-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: king_konf
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.2.0
20
+ version: 0.3.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.2.0
27
+ version: 0.3.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: ruby-kafka
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '0.5'
34
+ version: '0.6'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '0.5'
41
+ version: '0.6'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: bundler
44
44
  requirement: !ruby/object:Gem::Requirement