rimless 2.9.0 → 3.1.0
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 +4 -4
- data/Appraisals +2 -2
- data/CHANGELOG.md +70 -0
- data/Gemfile +0 -1
- data/README.md +64 -62
- data/Rakefile +13 -4
- data/UPGRADING.md +491 -0
- data/doc/kafka-playground/Dockerfile +5 -5
- data/doc/kafka-playground/Gemfile +1 -1
- data/doc/kafka-playground/Gemfile.lock +178 -140
- data/doc/kafka-playground/README.md +1 -1
- data/doc/kafka-playground/bin/consume-topic +1 -1
- data/doc/kafka-playground/bin/create-topic +28 -17
- data/doc/kafka-playground/bin/delete-topic +8 -3
- data/doc/kafka-playground/bin/list-topics +1 -1
- data/doc/kafka-playground/bin/produce-event +31 -18
- data/doc/kafka-playground/config/environment.rb +6 -38
- data/doc/kafka-playground/config/initializers/resolv.rb +59 -0
- data/doc/kafka-playground/config/initializers/rimless.rb +39 -0
- data/doc/kafka-playground/examples/rimless-produce +19 -20
- data/doc/upgrade-guide-sources/README.md +221 -0
- data/doc/upgrade-guide-sources/dep-avro_turf-1.20.md +23 -0
- data/doc/upgrade-guide-sources/dep-karafka-2.0.md +117 -0
- data/doc/upgrade-guide-sources/dep-waterdrop-2.8.md +30 -0
- data/gemfiles/rails_8.0.gemfile +1 -1
- data/gemfiles/rails_8.1.gemfile +1 -1
- data/lib/rimless/compatibility/.gitkeep +0 -0
- data/lib/rimless/configuration.rb +80 -6
- data/lib/rimless/consumer/app.rb +182 -0
- data/lib/rimless/{karafka → consumer}/avro_deserializer.rb +8 -6
- data/lib/rimless/consumer/base.rb +118 -0
- data/lib/rimless/consumer/job.rb +35 -0
- data/lib/rimless/consumer/job_bridge.rb +113 -0
- data/lib/rimless/extensions/avro_helpers.rb +83 -0
- data/lib/rimless/extensions/configuration_handling.rb +77 -0
- data/lib/rimless/extensions/consumer.rb +20 -0
- data/lib/rimless/extensions/dependencies.rb +84 -0
- data/lib/rimless/extensions/kafka_helpers.rb +46 -0
- data/lib/rimless/extensions/producer.rb +103 -0
- data/lib/rimless/initializers/compatibility.rb +3 -4
- data/lib/rimless/railtie.rb +7 -7
- data/lib/rimless/rspec/helpers.rb +53 -13
- data/lib/rimless/rspec/matchers.rb +14 -11
- data/lib/rimless/rspec.rb +13 -29
- data/lib/rimless/tasks/consumer.rake +18 -6
- data/lib/rimless/tasks/templates/application_consumer.rb +1 -1
- data/lib/rimless/tasks/templates/custom_consumer.rb +1 -1
- data/lib/rimless/tasks/templates/custom_consumer_spec.rb +5 -4
- data/lib/rimless/tasks/templates/karafka.rb +5 -4
- data/lib/rimless/version.rb +3 -1
- data/lib/rimless.rb +12 -14
- data/rimless.gemspec +7 -9
- metadata +40 -67
- data/lib/rimless/avro_helpers.rb +0 -81
- data/lib/rimless/base_consumer.rb +0 -30
- data/lib/rimless/compatibility/karafka_1_4.rb +0 -52
- data/lib/rimless/configuration_handling.rb +0 -82
- data/lib/rimless/consumer.rb +0 -209
- data/lib/rimless/consumer_job.rb +0 -10
- data/lib/rimless/dependencies.rb +0 -69
- data/lib/rimless/kafka_helpers.rb +0 -104
- data/lib/rimless/karafka/base64_interchanger.rb +0 -32
- data/lib/rimless/karafka/passthrough_mapper.rb +0 -29
- data/lib/rimless/tasks/stats.rake +0 -22
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
GEM
|
|
2
2
|
remote: https://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
|
|
4
|
+
activejob (8.1.3)
|
|
5
|
+
activesupport (= 8.1.3)
|
|
6
|
+
globalid (>= 0.3.6)
|
|
7
|
+
activesupport (8.1.3)
|
|
5
8
|
base64
|
|
6
9
|
bigdecimal
|
|
7
10
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
@@ -14,163 +17,198 @@ GEM
|
|
|
14
17
|
securerandom (>= 0.3)
|
|
15
18
|
tzinfo (~> 2.0, >= 2.0.5)
|
|
16
19
|
uri (>= 0.13.1)
|
|
17
|
-
addressable (2.8.
|
|
18
|
-
public_suffix (>= 2.0.2, <
|
|
19
|
-
avro (1.
|
|
20
|
-
multi_json
|
|
21
|
-
avro_turf (
|
|
22
|
-
avro (>= 1.
|
|
23
|
-
excon (
|
|
24
|
-
base64 (0.
|
|
25
|
-
bigdecimal (
|
|
26
|
-
concurrent-ruby (1.3.
|
|
27
|
-
connection_pool (
|
|
28
|
-
crack (1.0.
|
|
20
|
+
addressable (2.8.9)
|
|
21
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
22
|
+
avro (1.12.1)
|
|
23
|
+
multi_json (~> 1.0)
|
|
24
|
+
avro_turf (1.20.1)
|
|
25
|
+
avro (>= 1.11.3, < 1.13)
|
|
26
|
+
excon (>= 0.104, < 2)
|
|
27
|
+
base64 (0.3.0)
|
|
28
|
+
bigdecimal (4.1.0)
|
|
29
|
+
concurrent-ruby (1.3.6)
|
|
30
|
+
connection_pool (3.0.2)
|
|
31
|
+
crack (1.0.1)
|
|
29
32
|
bigdecimal
|
|
30
33
|
rexml
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
dry-initializer (3.1.1)
|
|
50
|
-
dry-logic (1.3.0)
|
|
51
|
-
concurrent-ruby (~> 1.0)
|
|
52
|
-
dry-core (~> 0.9, >= 0.9)
|
|
53
|
-
zeitwerk (~> 2.6)
|
|
54
|
-
dry-monitor (0.7.0)
|
|
55
|
-
dry-configurable (~> 0.16, >= 0.16.0)
|
|
56
|
-
dry-core (~> 0.9, >= 0.9)
|
|
57
|
-
dry-events (~> 0.4, >= 0.4.0)
|
|
58
|
-
dry-schema (1.11.3)
|
|
59
|
-
concurrent-ruby (~> 1.0)
|
|
60
|
-
dry-configurable (~> 0.16, >= 0.16)
|
|
61
|
-
dry-core (~> 0.9, >= 0.9)
|
|
62
|
-
dry-initializer (~> 3.0)
|
|
63
|
-
dry-logic (~> 1.3)
|
|
64
|
-
dry-types (~> 1.6)
|
|
65
|
-
zeitwerk (~> 2.6)
|
|
66
|
-
dry-types (1.6.1)
|
|
67
|
-
concurrent-ruby (~> 1.0)
|
|
68
|
-
dry-container (~> 0.3)
|
|
69
|
-
dry-core (~> 0.9, >= 0.9)
|
|
70
|
-
dry-inflector (~> 0.1, >= 0.1.2)
|
|
71
|
-
dry-logic (~> 1.3, >= 1.3)
|
|
72
|
-
zeitwerk (~> 2.6)
|
|
73
|
-
dry-validation (1.9.0)
|
|
74
|
-
concurrent-ruby (~> 1.0)
|
|
75
|
-
dry-container (~> 0.7, >= 0.7.1)
|
|
76
|
-
dry-core (~> 0.9, >= 0.9)
|
|
77
|
-
dry-initializer (~> 3.0)
|
|
78
|
-
dry-schema (~> 1.11, >= 1.11.0)
|
|
79
|
-
zeitwerk (~> 2.6)
|
|
80
|
-
envlogic (1.1.5)
|
|
81
|
-
dry-inflector (~> 0.1)
|
|
82
|
-
excon (0.112.0)
|
|
83
|
-
hashdiff (1.1.2)
|
|
84
|
-
i18n (1.14.7)
|
|
34
|
+
drb (2.2.3)
|
|
35
|
+
excon (1.4.2)
|
|
36
|
+
logger
|
|
37
|
+
ffi (1.17.4)
|
|
38
|
+
ffi (1.17.4-aarch64-linux-gnu)
|
|
39
|
+
ffi (1.17.4-aarch64-linux-musl)
|
|
40
|
+
ffi (1.17.4-arm-linux-gnu)
|
|
41
|
+
ffi (1.17.4-arm-linux-musl)
|
|
42
|
+
ffi (1.17.4-arm64-darwin)
|
|
43
|
+
ffi (1.17.4-x86-linux-gnu)
|
|
44
|
+
ffi (1.17.4-x86-linux-musl)
|
|
45
|
+
ffi (1.17.4-x86_64-darwin)
|
|
46
|
+
ffi (1.17.4-x86_64-linux-gnu)
|
|
47
|
+
ffi (1.17.4-x86_64-linux-musl)
|
|
48
|
+
globalid (1.3.0)
|
|
49
|
+
activesupport (>= 6.1)
|
|
50
|
+
hashdiff (1.2.1)
|
|
51
|
+
i18n (1.14.8)
|
|
85
52
|
concurrent-ruby (~> 1.0)
|
|
86
|
-
json (2.
|
|
87
|
-
karafka (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
karafka-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
53
|
+
json (2.19.3)
|
|
54
|
+
karafka (2.5.9)
|
|
55
|
+
karafka-core (>= 2.5.6, < 2.6.0)
|
|
56
|
+
karafka-rdkafka (>= 0.24.0)
|
|
57
|
+
waterdrop (>= 2.8.14, < 3.0.0)
|
|
58
|
+
zeitwerk (~> 2.3)
|
|
59
|
+
karafka-core (2.5.10)
|
|
60
|
+
karafka-rdkafka (>= 0.20.0)
|
|
61
|
+
logger (>= 1.6.0)
|
|
62
|
+
karafka-rdkafka (0.24.0)
|
|
63
|
+
ffi (~> 1.17.1)
|
|
64
|
+
json (> 2.0)
|
|
65
|
+
logger
|
|
66
|
+
mini_portile2 (~> 2.6)
|
|
67
|
+
rake (> 12)
|
|
68
|
+
karafka-rdkafka (0.24.0-aarch64-linux-gnu)
|
|
69
|
+
ffi (~> 1.17.1)
|
|
70
|
+
json (> 2.0)
|
|
71
|
+
logger
|
|
72
|
+
mini_portile2 (~> 2.6)
|
|
73
|
+
rake (> 12)
|
|
74
|
+
karafka-rdkafka (0.24.0-aarch64-linux-musl)
|
|
75
|
+
ffi (~> 1.17.1)
|
|
76
|
+
json (> 2.0)
|
|
77
|
+
logger
|
|
78
|
+
mini_portile2 (~> 2.6)
|
|
79
|
+
rake (> 12)
|
|
80
|
+
karafka-rdkafka (0.24.0-arm64-darwin)
|
|
81
|
+
ffi (~> 1.17.1)
|
|
82
|
+
json (> 2.0)
|
|
83
|
+
logger
|
|
84
|
+
mini_portile2 (~> 2.6)
|
|
85
|
+
rake (> 12)
|
|
86
|
+
karafka-rdkafka (0.24.0-x86_64-linux-gnu)
|
|
87
|
+
ffi (~> 1.17.1)
|
|
88
|
+
json (> 2.0)
|
|
89
|
+
logger
|
|
90
|
+
mini_portile2 (~> 2.6)
|
|
91
|
+
rake (> 12)
|
|
92
|
+
karafka-rdkafka (0.24.0-x86_64-linux-musl)
|
|
93
|
+
ffi (~> 1.17.1)
|
|
94
|
+
json (> 2.0)
|
|
95
|
+
logger
|
|
96
|
+
mini_portile2 (~> 2.6)
|
|
97
|
+
rake (> 12)
|
|
98
|
+
karafka-testing (2.5.5)
|
|
99
|
+
karafka (>= 2.5.0, < 2.6.0)
|
|
100
|
+
waterdrop (>= 2.8.0)
|
|
101
|
+
logger (1.7.0)
|
|
102
|
+
mini_portile2 (2.8.9)
|
|
103
|
+
minitest (6.0.3)
|
|
104
|
+
drb (~> 2.0)
|
|
105
|
+
prism (~> 1.5)
|
|
106
|
+
multi_json (1.19.1)
|
|
107
|
+
prism (1.9.0)
|
|
108
|
+
public_suffix (7.0.5)
|
|
109
|
+
rake (13.3.1)
|
|
118
110
|
retries (0.0.5)
|
|
119
|
-
rexml (3.4.
|
|
120
|
-
rimless (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
karafka
|
|
125
|
-
karafka-testing (~>
|
|
126
|
-
|
|
127
|
-
ostruct (>= 0.6)
|
|
111
|
+
rexml (3.4.4)
|
|
112
|
+
rimless (3.0.0)
|
|
113
|
+
activejob (>= 8.0)
|
|
114
|
+
activesupport (>= 8.0)
|
|
115
|
+
avro_turf (~> 1.20)
|
|
116
|
+
karafka (~> 2.5)
|
|
117
|
+
karafka-testing (~> 2.5)
|
|
118
|
+
logger (~> 1.7)
|
|
128
119
|
retries (>= 0.0.5)
|
|
129
|
-
sinatra (>= 2.2)
|
|
130
120
|
sparsify (~> 1.1)
|
|
131
|
-
waterdrop (~>
|
|
132
|
-
webmock (~> 3.
|
|
133
|
-
zeitwerk (~> 2.
|
|
134
|
-
|
|
135
|
-
digest-crc
|
|
136
|
-
ruby2_keywords (0.0.5)
|
|
137
|
-
securerandom (0.3.2)
|
|
138
|
-
sidekiq (7.3.9)
|
|
139
|
-
base64
|
|
140
|
-
connection_pool (>= 2.3.0)
|
|
141
|
-
logger
|
|
142
|
-
rack (>= 2.2.4)
|
|
143
|
-
redis-client (>= 0.22.2)
|
|
144
|
-
sinatra (2.2.4)
|
|
145
|
-
mustermann (~> 2.0)
|
|
146
|
-
rack (~> 2.2)
|
|
147
|
-
rack-protection (= 2.2.4)
|
|
148
|
-
tilt (~> 2.0)
|
|
121
|
+
waterdrop (~> 2.8)
|
|
122
|
+
webmock (~> 3.26)
|
|
123
|
+
zeitwerk (~> 2.7)
|
|
124
|
+
securerandom (0.4.1)
|
|
149
125
|
sparsify (1.1.0)
|
|
150
126
|
thor (1.5.0)
|
|
151
|
-
tilt (2.6.0)
|
|
152
127
|
tzinfo (2.0.6)
|
|
153
128
|
concurrent-ruby (~> 1.0)
|
|
154
129
|
uri (1.1.1)
|
|
155
|
-
waterdrop (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
ruby-kafka (>= 1.3.0)
|
|
161
|
-
zeitwerk (~> 2.4)
|
|
162
|
-
webmock (3.25.0)
|
|
130
|
+
waterdrop (2.8.16)
|
|
131
|
+
karafka-core (>= 2.4.9, < 3.0.0)
|
|
132
|
+
karafka-rdkafka (>= 0.24.0)
|
|
133
|
+
zeitwerk (~> 2.3)
|
|
134
|
+
webmock (3.26.2)
|
|
163
135
|
addressable (>= 2.8.0)
|
|
164
136
|
crack (>= 0.3.2)
|
|
165
137
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
166
|
-
zeitwerk (2.
|
|
138
|
+
zeitwerk (2.7.5)
|
|
167
139
|
|
|
168
140
|
PLATFORMS
|
|
169
|
-
|
|
141
|
+
aarch64-linux-gnu
|
|
142
|
+
aarch64-linux-musl
|
|
143
|
+
arm-linux-gnu
|
|
144
|
+
arm-linux-musl
|
|
145
|
+
arm64-darwin
|
|
146
|
+
ruby
|
|
147
|
+
x86-linux-gnu
|
|
148
|
+
x86-linux-musl
|
|
149
|
+
x86_64-darwin
|
|
150
|
+
x86_64-linux-gnu
|
|
151
|
+
x86_64-linux-musl
|
|
170
152
|
|
|
171
153
|
DEPENDENCIES
|
|
172
|
-
rimless (~>
|
|
154
|
+
rimless (~> 3.0)
|
|
173
155
|
thor (~> 1.5)
|
|
174
156
|
|
|
157
|
+
CHECKSUMS
|
|
158
|
+
activejob (8.1.3) sha256=a149b1766aa8204c3c3da7309e4becd40fcd5529c348cffbf6c9b16b565fe8d3
|
|
159
|
+
activesupport (8.1.3) sha256=21a5e0dfbd4c3ddd9e1317ec6a4d782fa226e7867dc70b0743acda81a1dca20e
|
|
160
|
+
addressable (2.8.9) sha256=cc154fcbe689711808a43601dee7b980238ce54368d23e127421753e46895485
|
|
161
|
+
avro (1.12.1) sha256=e2a32e605e935f9196d590bb193d1fa13b83d169303b811ecb614e67ad59ac43
|
|
162
|
+
avro_turf (1.20.1) sha256=3962f5fe05a5e6db65bd6d41943d0b0153636751c4dcb5ded4ab4d7d2ddd9abb
|
|
163
|
+
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
164
|
+
bigdecimal (4.1.0) sha256=6dc07767aa3dc456ccd48e7ae70a07b474e9afd7c5bc576f80bd6da5c8dd6cae
|
|
165
|
+
concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
|
|
166
|
+
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
|
|
167
|
+
crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e
|
|
168
|
+
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
169
|
+
excon (1.4.2) sha256=32d8d8eda619717d9b8043b4675e096fb5c2139b080e2ad3b267f88c545aaa35
|
|
170
|
+
ffi (1.17.4) sha256=bcd1642e06f0d16fc9e09ac6d49c3a7298b9789bcb58127302f934e437d60acf
|
|
171
|
+
ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df
|
|
172
|
+
ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39
|
|
173
|
+
ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564
|
|
174
|
+
ffi (1.17.4-arm-linux-musl) sha256=9d4838ded0465bef6e2426935f6bcc93134b6616785a84ffd2a3d82bc3cf6f95
|
|
175
|
+
ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b
|
|
176
|
+
ffi (1.17.4-x86-linux-gnu) sha256=38e150df5f4ca555e25beca4090823ae09657bceded154e3c52f8631c1ed72cf
|
|
177
|
+
ffi (1.17.4-x86-linux-musl) sha256=fbeec0fc7c795bcf86f623bb18d31ea1820f7bd580e1703a3d3740d527437809
|
|
178
|
+
ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496
|
|
179
|
+
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
|
|
180
|
+
ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e
|
|
181
|
+
globalid (1.3.0) sha256=05c639ad6eb4594522a0b07983022f04aa7254626ab69445a0e493aa3786ff11
|
|
182
|
+
hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1
|
|
183
|
+
i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5
|
|
184
|
+
json (2.19.3) sha256=289b0bb53052a1fa8c34ab33cc750b659ba14a5c45f3fcf4b18762dc67c78646
|
|
185
|
+
karafka (2.5.9) sha256=a9806644f75aafd62f40f1c203ec485250f42a1520d1e14d7e7ba4bf23f3321f
|
|
186
|
+
karafka-core (2.5.10) sha256=a4f9127186728502decf0817d366b4eec46593390047c278acddb636e63e384c
|
|
187
|
+
karafka-rdkafka (0.24.0) sha256=91e9eb753d7f72036721af4ce0f3f2dcf7c145a2e324fc1cba7b6f837def4e09
|
|
188
|
+
karafka-rdkafka (0.24.0-aarch64-linux-gnu) sha256=1685c91b81ee97d81528f03db292eadad3a7e191b29613f24d5ba9a7a434f097
|
|
189
|
+
karafka-rdkafka (0.24.0-aarch64-linux-musl) sha256=498c70b2db1b89c2e68d6d8b8884cf60a5e3b24747c077c72dc0329007f6ba36
|
|
190
|
+
karafka-rdkafka (0.24.0-arm64-darwin) sha256=08863151181c7aebd028049f9e8ff75ed55f9b1846f7eedb4dd82937cf18845f
|
|
191
|
+
karafka-rdkafka (0.24.0-x86_64-linux-gnu) sha256=a1c8561f6df2e3d466053cebeeab6ae96ebd7aa931632ab49d18a71cae978633
|
|
192
|
+
karafka-rdkafka (0.24.0-x86_64-linux-musl) sha256=dcb3f4017d204bb3c46dd39b41dbe568eee6babc69063663a1ce6e13ce08136e
|
|
193
|
+
karafka-testing (2.5.5) sha256=fa7ca34b0760ea76a392113813a122f07ffbade300e145c2190555db4619d338
|
|
194
|
+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
195
|
+
mini_portile2 (2.8.9) sha256=0cd7c7f824e010c072e33f68bc02d85a00aeb6fce05bb4819c03dfd3c140c289
|
|
196
|
+
minitest (6.0.3) sha256=88ac8a1de36c00692420e7cb3cc11a0773bbcb126aee1c249f320160a7d11411
|
|
197
|
+
multi_json (1.19.1) sha256=7aefeff8f2c854bf739931a238e4aea64592845e0c0395c8a7d2eea7fdd631b7
|
|
198
|
+
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
199
|
+
public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
|
|
200
|
+
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
|
|
201
|
+
retries (0.0.5) sha256=47b9be7935151d4ad5b63b10886fa602f2c9776a0a01466cb56a50ef0d9bb1cf
|
|
202
|
+
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
|
|
203
|
+
rimless (3.0.0) sha256=2c36fbbe041a0f0c161cad9dea32d849440accce0ca91153a500fef21ad2e903
|
|
204
|
+
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
|
|
205
|
+
sparsify (1.1.0) sha256=b36ccdcd8c7540a9bc86514a78183819d424408c4dfd679820983d8d1b7a0e30
|
|
206
|
+
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
|
|
207
|
+
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
|
|
208
|
+
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
|
|
209
|
+
waterdrop (2.8.16) sha256=a48e795b5eaeb3cef77b4eb0f98e9e88e657cf02a8120bc8a1597dc6bf9626c1
|
|
210
|
+
webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90
|
|
211
|
+
zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd
|
|
212
|
+
|
|
175
213
|
BUNDLED WITH
|
|
176
|
-
|
|
214
|
+
4.0.9
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
4
|
require_relative '../config/environment'
|
|
4
5
|
|
|
@@ -6,37 +7,47 @@ class CreateTopic < Thor
|
|
|
6
7
|
default_command :create
|
|
7
8
|
|
|
8
9
|
desc 'NAME [CONFIGS...]', 'create a new Apache Kafka topic'
|
|
9
|
-
option :partitions,
|
|
10
|
+
option :partitions,
|
|
11
|
+
aliases: '-p',
|
|
12
|
+
type: :numeric,
|
|
13
|
+
default: 1,
|
|
10
14
|
desc: 'The number of partitions'
|
|
11
|
-
option :replicas,
|
|
15
|
+
option :replicas,
|
|
16
|
+
aliases: '-r',
|
|
17
|
+
type: :numeric,
|
|
18
|
+
default: 1,
|
|
12
19
|
desc: 'The number of replications'
|
|
13
|
-
option :verbose,
|
|
20
|
+
option :verbose,
|
|
21
|
+
aliases: '-v',
|
|
22
|
+
type: :boolean,
|
|
14
23
|
desc: 'Enable verbose outputs'
|
|
15
24
|
|
|
16
25
|
def create(name, *configs)
|
|
17
26
|
debug! options
|
|
18
27
|
|
|
19
|
-
opts = {
|
|
20
|
-
num_partitions: options[:partitions].to_i,
|
|
21
|
-
replication_factor: options[:replicas].to_i,
|
|
22
|
-
}
|
|
23
|
-
config = configs.map { |conf| conf.split('=').map(&:strip) }.to_h
|
|
24
|
-
|
|
25
28
|
if topic?(name)
|
|
26
|
-
|
|
27
|
-
puts JSON.pretty_generate(
|
|
29
|
+
warn "The topic '#{name}' already exists."
|
|
30
|
+
puts JSON.pretty_generate(describe_topic(name))
|
|
28
31
|
exit
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
# Create the topic
|
|
32
|
-
|
|
35
|
+
KafkaAdminClient.create_topic(
|
|
36
|
+
name,
|
|
37
|
+
options[:partitions].to_i,
|
|
38
|
+
options[:replicas].to_i,
|
|
39
|
+
configs.to_h { |conf| conf.split('=').map(&:strip) }
|
|
40
|
+
).wait
|
|
33
41
|
|
|
34
42
|
# Fetch the topic config
|
|
35
|
-
puts JSON.pretty_generate(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
puts JSON.pretty_generate(describe_topic(name))
|
|
44
|
+
KafkaAdminClient.close
|
|
45
|
+
rescue Rdkafka::RdkafkaError, Rdkafka::Config::ConfigError => e
|
|
46
|
+
warn "Could not create the topic '#{name}'."
|
|
47
|
+
warn "The given configuration is invalid:\n\n"
|
|
48
|
+
warn JSON.pretty_generate(configs)
|
|
49
|
+
$stderr.puts
|
|
50
|
+
warn e.message
|
|
40
51
|
exit 1
|
|
41
52
|
end
|
|
42
53
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
4
|
require_relative '../config/environment'
|
|
4
5
|
|
|
@@ -6,18 +7,22 @@ class DeleteTopic < Thor
|
|
|
6
7
|
default_command :delete
|
|
7
8
|
|
|
8
9
|
desc 'NAME', 'delete an existing Apache Kafka topic'
|
|
9
|
-
option :verbose,
|
|
10
|
+
option :verbose,
|
|
11
|
+
aliases: '-v',
|
|
12
|
+
type: :boolean,
|
|
10
13
|
desc: 'Enable verbose outputs'
|
|
11
14
|
|
|
12
15
|
def delete(name)
|
|
13
16
|
debug! options
|
|
14
17
|
|
|
15
18
|
unless topic?(name)
|
|
16
|
-
|
|
19
|
+
warn "The topic '#{name}' does not exists."
|
|
17
20
|
exit 1
|
|
18
21
|
end
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
puts JSON.pretty_generate(describe_topic(name))
|
|
24
|
+
KafkaAdminClient.delete_topic(name).wait
|
|
25
|
+
KafkaAdminClient.close
|
|
21
26
|
end
|
|
22
27
|
end
|
|
23
28
|
DeleteTopic.start(args!)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
4
|
require_relative '../config/environment'
|
|
4
5
|
|
|
@@ -6,25 +7,25 @@ class ProduceTopic < Thor
|
|
|
6
7
|
default_command :produce
|
|
7
8
|
|
|
8
9
|
desc 'TOPIC FILE...', 'produce a new event at a given Apache Kafka topic'
|
|
9
|
-
option :partition,
|
|
10
|
+
option :partition,
|
|
11
|
+
aliases: '-p',
|
|
12
|
+
type: :numeric,
|
|
10
13
|
desc: 'The topic partitions to write to'
|
|
11
|
-
option :partition_key,
|
|
14
|
+
option :partition_key,
|
|
15
|
+
aliases: '-k',
|
|
16
|
+
type: :string,
|
|
12
17
|
desc: 'The partition key to use to select the partition'
|
|
13
|
-
option :verbose,
|
|
18
|
+
option :verbose,
|
|
19
|
+
aliases: '-v',
|
|
20
|
+
type: :boolean,
|
|
14
21
|
desc: 'Enable verbose outputs'
|
|
15
22
|
|
|
16
23
|
def produce(topic, *files)
|
|
17
24
|
debug! options
|
|
18
25
|
|
|
19
|
-
opts = {
|
|
20
|
-
topic: topic,
|
|
21
|
-
partition: options[:partition]&.to_i,
|
|
22
|
-
partition_key: options[:partition_key]
|
|
23
|
-
}.compact
|
|
24
|
-
|
|
25
26
|
if options.key?(:partition) && options.key?(:partition_key)
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
warn 'Either use the fixed partition or a partition key.'
|
|
28
|
+
warn 'But not both together.'
|
|
28
29
|
exit 1
|
|
29
30
|
end
|
|
30
31
|
|
|
@@ -32,7 +33,7 @@ class ProduceTopic < Thor
|
|
|
32
33
|
next '/dev/stdin' if file == '-'
|
|
33
34
|
|
|
34
35
|
unless File.file? file
|
|
35
|
-
|
|
36
|
+
warn "File '#{file}' does not exist."
|
|
36
37
|
next
|
|
37
38
|
end
|
|
38
39
|
|
|
@@ -40,26 +41,38 @@ class ProduceTopic < Thor
|
|
|
40
41
|
end.compact.uniq
|
|
41
42
|
|
|
42
43
|
if files.empty?
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
warn 'No files given or exists.'
|
|
45
|
+
warn 'You have to specify file(s) or use `-\' for stdin.'
|
|
45
46
|
exit 1
|
|
46
47
|
end
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
delivery_handles = []
|
|
50
|
+
producer = $rdkafka_config.producer
|
|
49
51
|
|
|
50
52
|
files.each do |file|
|
|
51
53
|
puts "Processing lines of '#{file}' .."
|
|
52
54
|
File.open(file, 'r') do |f|
|
|
53
55
|
f.each_line.lazy.each do |line|
|
|
54
56
|
puts line
|
|
55
|
-
producer.produce(
|
|
57
|
+
delivery_handles << producer.produce(
|
|
58
|
+
topic: topic,
|
|
59
|
+
payload: line,
|
|
60
|
+
**{
|
|
61
|
+
partition: options[:partition]&.to_i,
|
|
62
|
+
partition_key: options[:partition_key]
|
|
63
|
+
}.compact
|
|
64
|
+
)
|
|
56
65
|
puts
|
|
57
66
|
end
|
|
58
67
|
end
|
|
59
|
-
|
|
68
|
+
delivery_handles.each(&:wait)
|
|
69
|
+
producer.flush
|
|
70
|
+
producer.close
|
|
60
71
|
end
|
|
61
72
|
rescue Interrupt
|
|
62
|
-
|
|
73
|
+
delivery_handles.each(&:wait)
|
|
74
|
+
producer.flush
|
|
75
|
+
producer.close
|
|
63
76
|
end
|
|
64
77
|
end
|
|
65
78
|
ProduceTopic.start(args!)
|
|
@@ -5,53 +5,21 @@ require 'bundler/setup' # Set up gems listed in the Gemfile.
|
|
|
5
5
|
require 'active_support'
|
|
6
6
|
require 'active_support/all'
|
|
7
7
|
require 'json'
|
|
8
|
-
require 'pp'
|
|
9
8
|
|
|
10
9
|
Bundler.require(:default)
|
|
11
10
|
ActiveSupport.eager_load!
|
|
12
11
|
|
|
13
|
-
AppLogger = Logger.new(
|
|
12
|
+
AppLogger = Logger.new($stdout)
|
|
14
13
|
AppLogger.level = Logger::FATAL
|
|
15
|
-
AppLogger.level = Logger::DEBUG if ENV.fetch('DEBUG', '').match?
|
|
14
|
+
AppLogger.level = Logger::DEBUG if ENV.fetch('DEBUG', '').match?(/true|1|on/)
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
conf.env = 'production'
|
|
19
|
-
conf.app_name = 'playground_app'
|
|
20
|
-
conf.client_id = 'playground'
|
|
21
|
-
conf.logger = AppLogger
|
|
22
|
-
conf.kafka_brokers = ['kafka://kafka.playground.local:9092']
|
|
23
|
-
conf.schema_registry_url = 'http://schema-registry.playground.local'
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
KafkaClient = Kafka.new(Rimless.configuration.kafka_brokers, logger: AppLogger)
|
|
27
|
-
|
|
28
|
-
# +Resolv+ is a thread-aware DNS resolver library written in Ruby. Some newer
|
|
29
|
-
# networking libraries like excon (>=0.85.0) makes use of it instead of the
|
|
30
|
-
# regular glibc facility. This raises an issue for our local development as we
|
|
31
|
-
# use the mDNS stack which is configured in every Docker image accordingly
|
|
32
|
-
# (Avahi, libnss[-mdns]). The default resolver of +Resolv+ does not include the
|
|
33
|
-
# mDNS stack so we have to reconfigure it here for local usage only.
|
|
34
|
-
#
|
|
35
|
-
# See: https://docs.ruby-lang.org/en/2.7.0/Resolv.html
|
|
36
|
-
require 'resolv'
|
|
37
|
-
Resolv::DefaultResolver.replace_resolvers(
|
|
38
|
-
[
|
|
39
|
-
Resolv::Hosts.new,
|
|
40
|
-
Resolv::MDNS.new,
|
|
41
|
-
Resolv::DNS.new
|
|
42
|
-
]
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
def topic?(name)
|
|
46
|
-
@topic_conf = KafkaClient.describe_topic(name)
|
|
47
|
-
rescue Kafka::UnknownTopicOrPartition
|
|
48
|
-
false
|
|
49
|
-
end
|
|
16
|
+
Dir[File.expand_path('initializers/*.rb', __dir__)].each { |f| require f }
|
|
50
17
|
|
|
51
18
|
def args!
|
|
52
19
|
app = Thor.descendants.map(&:to_s)
|
|
53
|
-
|
|
54
|
-
raise
|
|
20
|
+
.reject { |klass| klass.include? '::' }.first
|
|
21
|
+
raise 'No Thor application class was found.' unless app
|
|
22
|
+
|
|
55
23
|
app = app.constantize
|
|
56
24
|
|
|
57
25
|
help = ARGV.any? { |arg| %w[help -h --help].include?(arg) }
|