phobos 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/config/phobos.yml.example +7 -0
- data/lib/phobos/cli/start.rb +2 -2
- data/lib/phobos/executor.rb +5 -0
- data/lib/phobos/listener.rb +16 -4
- data/lib/phobos/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a1be0c7e093c341850150a4fc386bb858a4cb37
|
4
|
+
data.tar.gz: 6873ff23a925070291916c4b227a4b139bc44463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08520a3dd1a8c53057561853ff1651a710a911128a2ef75ce65bb5f82c501c537317a92d473bdc82b4a2270acbd5c0cfd418397c68db286690b7387636f254bc'
|
7
|
+
data.tar.gz: 88ffede29159f84ed85f9b1a9c2efb5bc5a4b39f4b04d37cb2d9c690e828d27236c00dce1ecb365ab58a5e8efd503c2e2854cbb45d0bb074e829b48d37b977ff
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
7
7
|
## UNRELEASED
|
8
8
|
|
9
|
+
## [1.7.2] - 2018-05-03
|
10
|
+
### Added
|
11
|
+
- Add ability to override session_timeout, heartbeat_interval, offset_retention_time, offset_commit_interval, and offset_commit_threshold per listener
|
12
|
+
### Changed
|
13
|
+
- Phobos CLI: Load boot file before configuring (instead of after)
|
14
|
+
|
9
15
|
## [1.7.1] - 2018-02-22
|
10
16
|
### Fixed
|
11
17
|
- Phobos overwrites ENV['RAILS_ENV'] with incorrect value #71
|
data/config/phobos.yml.example
CHANGED
@@ -114,3 +114,10 @@ listeners:
|
|
114
114
|
backoff:
|
115
115
|
min_ms: 500
|
116
116
|
max_ms: 10000
|
117
|
+
# session_timeout, offset_commit_interval, offset_commit_threshold, offset_retention_time, and heartbeat_interval
|
118
|
+
# can be customized per listener if desired
|
119
|
+
session_timeout: 30
|
120
|
+
offset_commit_interval: 15
|
121
|
+
offset_commit_threshold: 5
|
122
|
+
offset_retention_time: 172800
|
123
|
+
heartbeat_interval: 20
|
data/lib/phobos/cli/start.rb
CHANGED
data/lib/phobos/executor.rb
CHANGED
data/lib/phobos/listener.rb
CHANGED
@@ -20,7 +20,11 @@ module Phobos
|
|
20
20
|
max_wait_time: nil, force_encoding: nil,
|
21
21
|
start_from_beginning: true, backoff: nil,
|
22
22
|
delivery: 'batch',
|
23
|
-
max_bytes_per_partition: DEFAULT_MAX_BYTES_PER_PARTITION
|
23
|
+
max_bytes_per_partition: DEFAULT_MAX_BYTES_PER_PARTITION,
|
24
|
+
session_timeout: nil, offset_commit_interval: nil,
|
25
|
+
heartbeat_interval: nil, offset_commit_threshold: nil,
|
26
|
+
offset_retention_time: nil
|
27
|
+
)
|
24
28
|
@id = SecureRandom.hex[0...6]
|
25
29
|
@handler_class = handler
|
26
30
|
@group_id = group_id
|
@@ -31,8 +35,15 @@ module Phobos
|
|
31
35
|
start_from_beginning: start_from_beginning,
|
32
36
|
max_bytes_per_partition: max_bytes_per_partition
|
33
37
|
}
|
38
|
+
@kafka_consumer_opts = compact(
|
39
|
+
session_timeout: session_timeout,
|
40
|
+
offset_commit_interval: offset_commit_interval,
|
41
|
+
heartbeat_interval: heartbeat_interval,
|
42
|
+
offset_retention_time: offset_retention_time,
|
43
|
+
offset_commit_threshold: offset_commit_threshold
|
44
|
+
)
|
34
45
|
@encoding = Encoding.const_get(force_encoding.to_sym) if force_encoding
|
35
|
-
@
|
46
|
+
@message_processing_opts = compact(min_bytes: min_bytes, max_wait_time: max_wait_time)
|
36
47
|
@kafka_client = Phobos.create_kafka_client
|
37
48
|
@producer_enabled = @handler_class.ancestors.include?(Phobos::Producer)
|
38
49
|
end
|
@@ -84,7 +95,7 @@ module Phobos
|
|
84
95
|
end
|
85
96
|
|
86
97
|
def consume_each_batch
|
87
|
-
@consumer.each_batch(@
|
98
|
+
@consumer.each_batch(@message_processing_opts) do |batch|
|
88
99
|
batch_processor = Phobos::Actions::ProcessBatch.new(
|
89
100
|
listener: self,
|
90
101
|
batch: batch,
|
@@ -98,7 +109,7 @@ module Phobos
|
|
98
109
|
end
|
99
110
|
|
100
111
|
def consume_each_message
|
101
|
-
@consumer.each_message(@
|
112
|
+
@consumer.each_message(@message_processing_opts) do |message|
|
102
113
|
message_processor = Phobos::Actions::ProcessMessage.new(
|
103
114
|
listener: self,
|
104
115
|
message: message,
|
@@ -136,6 +147,7 @@ module Phobos
|
|
136
147
|
|
137
148
|
def create_kafka_consumer
|
138
149
|
configs = Phobos.config.consumer_hash.select { |k| KAFKA_CONSUMER_OPTS.include?(k) }
|
150
|
+
configs.merge!(@kafka_consumer_opts)
|
139
151
|
@kafka_client.consumer({ group_id: group_id }.merge(configs))
|
140
152
|
end
|
141
153
|
|
data/lib/phobos/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phobos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Túlio Ornelas
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2018-
|
17
|
+
date: 2018-05-03 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: bundler
|