deimos-ruby 1.9.1 → 1.9.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 +4 -2
- data/Gemfile.lock +1 -1
- data/lib/deimos.rb +0 -1
- data/lib/deimos/version.rb +1 -1
- metadata +1 -2
- data/lib/deimos/monkey_patches/ruby_kafka_heartbeat.rb +0 -85
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32eb1834570b6a1ea7d61274bf35be7365f16f1bb818c5c1148459bbc5a0b87a
|
4
|
+
data.tar.gz: eb1ea3e922b947c631f05c0e1a41ce65a3c7a366b42e9b5884de499fff14817b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9d27f061f4ddcc3db165c08aaa09c02d80471cfa8b815cb2fc91909a6992615a49697870f517e70fae958d8bd8fa022b2369310f839c5bcba60a415c9a95750
|
7
|
+
data.tar.gz: '0578c18592f11f646ae89b44a12c712ef86403b282ce9624c7e3127f5d54ba9f20faa634fd463e03b1287dd84d4bfddbecc2ee20e503a76b2f83a700c491b72e'
|
data/CHANGELOG.md
CHANGED
@@ -7,11 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## UNRELEASED
|
9
9
|
|
10
|
-
|
10
|
+
|
11
|
+
## 1.9.2 - 2021-01-29
|
11
12
|
|
12
13
|
- ### Fixes :wrench:
|
13
14
|
|
14
|
-
Fix for `uninitialized constant ActiveSupport::Autoload` in certain circumstances
|
15
|
+
- Fix for `uninitialized constant ActiveSupport::Autoload` in certain circumstances
|
16
|
+
- Removed unnecessary monkey patch which was crashing on newer versions of ruby-kafka
|
15
17
|
|
16
18
|
## 1.9.0 - 2021-01-28
|
17
19
|
|
data/Gemfile.lock
CHANGED
data/lib/deimos.rb
CHANGED
data/lib/deimos/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deimos-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
@@ -386,7 +386,6 @@ files:
|
|
386
386
|
- lib/deimos/metrics/provider.rb
|
387
387
|
- lib/deimos/monkey_patches/phobos_cli.rb
|
388
388
|
- lib/deimos/monkey_patches/phobos_producer.rb
|
389
|
-
- lib/deimos/monkey_patches/ruby_kafka_heartbeat.rb
|
390
389
|
- lib/deimos/poll_info.rb
|
391
390
|
- lib/deimos/producer.rb
|
392
391
|
- lib/deimos/railtie.rb
|
@@ -1,85 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Kafka
|
4
|
-
class Heartbeat
|
5
|
-
def initialize(group:, interval:, instrumenter:)
|
6
|
-
@group = group
|
7
|
-
@interval = interval
|
8
|
-
@last_heartbeat = Time.now
|
9
|
-
@instrumenter = instrumenter
|
10
|
-
end
|
11
|
-
|
12
|
-
def trigger!
|
13
|
-
@instrumenter.instrument('heartbeat.consumer',
|
14
|
-
group_id: @group.group_id,
|
15
|
-
topic_partitions: @group.assigned_partitions) do
|
16
|
-
@group.heartbeat
|
17
|
-
@last_heartbeat = Time.now
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class Client
|
23
|
-
def consumer(
|
24
|
-
group_id:,
|
25
|
-
session_timeout: 30,
|
26
|
-
offset_commit_interval: 10,
|
27
|
-
offset_commit_threshold: 0,
|
28
|
-
heartbeat_interval: 10,
|
29
|
-
offset_retention_time: nil,
|
30
|
-
fetcher_max_queue_size: 100
|
31
|
-
)
|
32
|
-
cluster = initialize_cluster
|
33
|
-
|
34
|
-
instrumenter = DecoratingInstrumenter.new(@instrumenter,
|
35
|
-
group_id: group_id)
|
36
|
-
|
37
|
-
# The Kafka protocol expects the retention time to be in ms.
|
38
|
-
retention_time = (offset_retention_time && offset_retention_time * 1_000) || -1
|
39
|
-
|
40
|
-
group = ConsumerGroup.new(
|
41
|
-
cluster: cluster,
|
42
|
-
logger: @logger,
|
43
|
-
group_id: group_id,
|
44
|
-
session_timeout: session_timeout,
|
45
|
-
retention_time: retention_time,
|
46
|
-
instrumenter: instrumenter
|
47
|
-
)
|
48
|
-
|
49
|
-
fetcher = Fetcher.new(
|
50
|
-
cluster: initialize_cluster,
|
51
|
-
group: group,
|
52
|
-
logger: @logger,
|
53
|
-
instrumenter: instrumenter,
|
54
|
-
max_queue_size: fetcher_max_queue_size
|
55
|
-
)
|
56
|
-
|
57
|
-
offset_manager = OffsetManager.new(
|
58
|
-
cluster: cluster,
|
59
|
-
group: group,
|
60
|
-
fetcher: fetcher,
|
61
|
-
logger: @logger,
|
62
|
-
commit_interval: offset_commit_interval,
|
63
|
-
commit_threshold: offset_commit_threshold,
|
64
|
-
offset_retention_time: offset_retention_time
|
65
|
-
)
|
66
|
-
|
67
|
-
heartbeat = Heartbeat.new(
|
68
|
-
group: group,
|
69
|
-
interval: heartbeat_interval,
|
70
|
-
instrumenter: instrumenter
|
71
|
-
)
|
72
|
-
|
73
|
-
Consumer.new(
|
74
|
-
cluster: cluster,
|
75
|
-
logger: @logger,
|
76
|
-
instrumenter: instrumenter,
|
77
|
-
group: group,
|
78
|
-
offset_manager: offset_manager,
|
79
|
-
fetcher: fetcher,
|
80
|
-
session_timeout: session_timeout,
|
81
|
-
heartbeat: heartbeat
|
82
|
-
)
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|