karafka 1.4.10 → 2.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/FUNDING.yml +3 -0
- data/.github/workflows/ci.yml +79 -26
- data/.ruby-version +1 -1
- data/CHANGELOG.md +46 -0
- data/CONTRIBUTING.md +6 -6
- data/Gemfile +6 -0
- data/Gemfile.lock +45 -53
- data/LICENSE +17 -0
- data/LICENSE-COMM +89 -0
- data/LICENSE-LGPL +165 -0
- data/README.md +16 -48
- data/bin/benchmarks +85 -0
- data/bin/create_token +28 -0
- data/bin/integrations +160 -0
- data/bin/karafka +4 -0
- data/bin/stress +13 -0
- data/certs/karafka-pro.pem +11 -0
- data/config/errors.yml +5 -38
- data/docker-compose.yml +12 -3
- data/karafka.gemspec +14 -14
- data/lib/active_job/karafka.rb +20 -0
- data/lib/active_job/queue_adapters/karafka_adapter.rb +26 -0
- data/lib/karafka/active_job/consumer.rb +24 -0
- data/lib/karafka/active_job/dispatcher.rb +38 -0
- data/lib/karafka/active_job/job_extensions.rb +34 -0
- data/lib/karafka/active_job/job_options_contract.rb +15 -0
- data/lib/karafka/active_job/routing_extensions.rb +18 -0
- data/lib/karafka/app.rb +14 -20
- data/lib/karafka/base_consumer.rb +103 -34
- data/lib/karafka/cli/base.rb +4 -4
- data/lib/karafka/cli/info.rb +44 -9
- data/lib/karafka/cli/install.rb +3 -8
- data/lib/karafka/cli/server.rb +16 -43
- data/lib/karafka/cli.rb +4 -11
- data/lib/karafka/connection/client.rb +279 -93
- data/lib/karafka/connection/listener.rb +137 -38
- data/lib/karafka/connection/messages_buffer.rb +57 -0
- data/lib/karafka/connection/pauses_manager.rb +46 -0
- data/lib/karafka/connection/rebalance_manager.rb +62 -0
- data/lib/karafka/contracts/base.rb +23 -0
- data/lib/karafka/contracts/config.rb +44 -8
- data/lib/karafka/contracts/consumer_group.rb +1 -176
- data/lib/karafka/contracts/consumer_group_topic.rb +16 -8
- data/lib/karafka/contracts/server_cli_options.rb +2 -12
- data/lib/karafka/contracts.rb +1 -1
- data/lib/karafka/env.rb +46 -0
- data/lib/karafka/errors.rb +18 -18
- data/lib/karafka/helpers/multi_delegator.rb +2 -2
- data/lib/karafka/instrumentation/callbacks/error.rb +40 -0
- data/lib/karafka/instrumentation/callbacks/statistics.rb +42 -0
- data/lib/karafka/instrumentation/monitor.rb +14 -21
- data/lib/karafka/instrumentation/stdout_listener.rb +67 -91
- data/lib/karafka/instrumentation.rb +21 -0
- data/lib/karafka/licenser.rb +76 -0
- data/lib/karafka/{params → messages}/batch_metadata.rb +9 -13
- data/lib/karafka/messages/builders/batch_metadata.rb +52 -0
- data/lib/karafka/messages/builders/message.rb +38 -0
- data/lib/karafka/messages/builders/messages.rb +40 -0
- data/lib/karafka/{params/params.rb → messages/message.rb} +7 -12
- data/lib/karafka/messages/messages.rb +64 -0
- data/lib/karafka/{params → messages}/metadata.rb +4 -6
- data/lib/karafka/messages/seek.rb +9 -0
- data/lib/karafka/patches/rdkafka/consumer.rb +22 -0
- data/lib/karafka/pro/active_job/dispatcher.rb +58 -0
- data/lib/karafka/pro/active_job/job_options_contract.rb +27 -0
- data/lib/karafka/pro/loader.rb +29 -0
- data/lib/karafka/pro.rb +13 -0
- data/lib/karafka/processing/executor.rb +96 -0
- data/lib/karafka/processing/executors_buffer.rb +49 -0
- data/lib/karafka/processing/jobs/base.rb +18 -0
- data/lib/karafka/processing/jobs/consume.rb +28 -0
- data/lib/karafka/processing/jobs/revoked.rb +22 -0
- data/lib/karafka/processing/jobs/shutdown.rb +23 -0
- data/lib/karafka/processing/jobs_queue.rb +121 -0
- data/lib/karafka/processing/worker.rb +57 -0
- data/lib/karafka/processing/workers_batch.rb +22 -0
- data/lib/karafka/railtie.rb +75 -0
- data/lib/karafka/routing/builder.rb +15 -24
- data/lib/karafka/routing/consumer_group.rb +10 -18
- data/lib/karafka/routing/consumer_mapper.rb +1 -2
- data/lib/karafka/routing/router.rb +1 -1
- data/lib/karafka/routing/subscription_group.rb +53 -0
- data/lib/karafka/routing/subscription_groups_builder.rb +51 -0
- data/lib/karafka/routing/topic.rb +47 -25
- data/lib/karafka/runner.rb +59 -0
- data/lib/karafka/serialization/json/deserializer.rb +6 -15
- data/lib/karafka/server.rb +62 -25
- data/lib/karafka/setup/config.rb +98 -171
- data/lib/karafka/status.rb +13 -3
- data/lib/karafka/templates/example_consumer.rb.erb +16 -0
- data/lib/karafka/templates/karafka.rb.erb +14 -50
- data/lib/karafka/time_trackers/base.rb +19 -0
- data/lib/karafka/time_trackers/pause.rb +84 -0
- data/lib/karafka/time_trackers/poll.rb +65 -0
- data/lib/karafka/version.rb +1 -1
- data/lib/karafka.rb +35 -13
- data.tar.gz.sig +0 -0
- metadata +82 -104
- metadata.gz.sig +0 -0
- data/MIT-LICENCE +0 -18
- data/lib/karafka/assignment_strategies/round_robin.rb +0 -13
- data/lib/karafka/attributes_map.rb +0 -63
- data/lib/karafka/backends/inline.rb +0 -16
- data/lib/karafka/base_responder.rb +0 -226
- data/lib/karafka/cli/flow.rb +0 -48
- data/lib/karafka/cli/missingno.rb +0 -19
- data/lib/karafka/code_reloader.rb +0 -67
- data/lib/karafka/connection/api_adapter.rb +0 -158
- data/lib/karafka/connection/batch_delegator.rb +0 -55
- data/lib/karafka/connection/builder.rb +0 -23
- data/lib/karafka/connection/message_delegator.rb +0 -36
- data/lib/karafka/consumers/batch_metadata.rb +0 -10
- data/lib/karafka/consumers/callbacks.rb +0 -71
- data/lib/karafka/consumers/includer.rb +0 -64
- data/lib/karafka/consumers/responders.rb +0 -24
- data/lib/karafka/consumers/single_params.rb +0 -15
- data/lib/karafka/contracts/responder_usage.rb +0 -54
- data/lib/karafka/fetcher.rb +0 -42
- data/lib/karafka/helpers/class_matcher.rb +0 -88
- data/lib/karafka/helpers/config_retriever.rb +0 -46
- data/lib/karafka/helpers/inflector.rb +0 -26
- data/lib/karafka/params/builders/batch_metadata.rb +0 -30
- data/lib/karafka/params/builders/params.rb +0 -38
- data/lib/karafka/params/builders/params_batch.rb +0 -25
- data/lib/karafka/params/params_batch.rb +0 -60
- data/lib/karafka/patches/ruby_kafka.rb +0 -47
- data/lib/karafka/persistence/client.rb +0 -29
- data/lib/karafka/persistence/consumers.rb +0 -45
- data/lib/karafka/persistence/topics.rb +0 -48
- data/lib/karafka/responders/builder.rb +0 -36
- data/lib/karafka/responders/topic.rb +0 -55
- data/lib/karafka/routing/topic_mapper.rb +0 -53
- data/lib/karafka/serialization/json/serializer.rb +0 -31
- data/lib/karafka/setup/configurators/water_drop.rb +0 -36
- data/lib/karafka/templates/application_responder.rb.erb +0 -11
data/lib/karafka.rb
CHANGED
@@ -3,32 +3,48 @@
|
|
3
3
|
%w[
|
4
4
|
delegate
|
5
5
|
English
|
6
|
+
rdkafka
|
6
7
|
waterdrop
|
7
|
-
kafka
|
8
|
-
envlogic
|
9
8
|
json
|
10
9
|
thor
|
11
10
|
forwardable
|
12
11
|
fileutils
|
12
|
+
openssl
|
13
|
+
base64
|
14
|
+
date
|
13
15
|
dry-configurable
|
14
16
|
dry-validation
|
15
17
|
dry/events/publisher
|
16
|
-
dry/inflector
|
17
18
|
dry/monitor/notifications
|
18
|
-
dry/core/constants
|
19
19
|
zeitwerk
|
20
20
|
].each(&method(:require))
|
21
21
|
|
22
|
-
# Karafka
|
22
|
+
# Karafka framework main namespace
|
23
23
|
module Karafka
|
24
|
-
extend Envlogic
|
25
|
-
|
26
24
|
class << self
|
25
|
+
# @return [Karafka::Env] env instance that allows us to check environment
|
26
|
+
def env
|
27
|
+
@env ||= Env.new
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param environment [String, Symbol] new environment that we want to set
|
31
|
+
# @return [Karafka::Env] env instance
|
32
|
+
# @example Assign new environment to Karafka::App
|
33
|
+
# Karafka::App.env = :production
|
34
|
+
def env=(environment)
|
35
|
+
env.replace(environment.to_s)
|
36
|
+
end
|
37
|
+
|
27
38
|
# @return [Logger] logger that we want to use. Will use ::Karafka::Logger by default
|
28
39
|
def logger
|
29
40
|
@logger ||= App.config.logger
|
30
41
|
end
|
31
42
|
|
43
|
+
# @return [WaterDrop::Producer] waterdrop messages producer
|
44
|
+
def producer
|
45
|
+
@producer ||= App.config.producer
|
46
|
+
end
|
47
|
+
|
32
48
|
# @return [::Karafka::Monitor] monitor that we want to use
|
33
49
|
def monitor
|
34
50
|
@monitor ||= App.config.monitor
|
@@ -49,6 +65,11 @@ module Karafka
|
|
49
65
|
Pathname.new(File.expand_path('karafka', __dir__))
|
50
66
|
end
|
51
67
|
|
68
|
+
# @return [Boolean] true if there is a valid pro token present
|
69
|
+
def pro?
|
70
|
+
App.config.license.token != false
|
71
|
+
end
|
72
|
+
|
52
73
|
# @return [String] path to a default file that contains booting procedure etc
|
53
74
|
# @note By default it is a file called 'karafka.rb' but it can be specified as you wish if you
|
54
75
|
# have Karafka that is merged into a Sinatra/Rails app and karafka.rb is taken.
|
@@ -64,9 +85,10 @@ module Karafka
|
|
64
85
|
end
|
65
86
|
end
|
66
87
|
|
67
|
-
Zeitwerk::Loader
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
88
|
+
loader = Zeitwerk::Loader.for_gem
|
89
|
+
# Do not load Rails extensions by default, this will be handled by Railtie if they are needed
|
90
|
+
loader.ignore(Karafka.gem_root.join('lib/active_job'))
|
91
|
+
# Do not load pro components, this will be handled by license manager
|
92
|
+
loader.ignore(Karafka.gem_root.join('lib/karafka/pro'))
|
93
|
+
loader.setup
|
94
|
+
loader.eager_load
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.alpha2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
8
|
-
- Pavlo Vavruk
|
9
|
-
- Adam Gwozdowski
|
10
8
|
autorequire:
|
11
9
|
bindir: bin
|
12
10
|
cert_chain:
|
@@ -36,7 +34,7 @@ cert_chain:
|
|
36
34
|
R2P11bWoCtr70BsccVrN8jEhzwXngMyI2gVt750Y+dbTu1KgRqZKp/ECe7ZzPzXj
|
37
35
|
pIy9vHxTANKYVyI4qj8OrFdEM5BQNu8oQpL0iQ==
|
38
36
|
-----END CERTIFICATE-----
|
39
|
-
date:
|
37
|
+
date: 2022-02-19 00:00:00.000000000 Z
|
40
38
|
dependencies:
|
41
39
|
- !ruby/object:Gem::Dependency
|
42
40
|
name: dry-configurable
|
@@ -52,20 +50,6 @@ dependencies:
|
|
52
50
|
- - "~>"
|
53
51
|
- !ruby/object:Gem::Version
|
54
52
|
version: '0.13'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: dry-inflector
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0.2'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0.2'
|
69
53
|
- !ruby/object:Gem::Dependency
|
70
54
|
name: dry-monitor
|
71
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,94 +79,70 @@ dependencies:
|
|
95
79
|
- !ruby/object:Gem::Version
|
96
80
|
version: '1.7'
|
97
81
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '1.1'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '1.1'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: irb
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '1.3'
|
118
|
-
type: :runtime
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '1.3'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: ruby-kafka
|
82
|
+
name: rdkafka
|
127
83
|
requirement: !ruby/object:Gem::Requirement
|
128
84
|
requirements:
|
129
85
|
- - ">="
|
130
86
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
87
|
+
version: '0.10'
|
132
88
|
type: :runtime
|
133
89
|
prerelease: false
|
134
90
|
version_requirements: !ruby/object:Gem::Requirement
|
135
91
|
requirements:
|
136
92
|
- - ">="
|
137
93
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
94
|
+
version: '0.10'
|
139
95
|
- !ruby/object:Gem::Dependency
|
140
96
|
name: thor
|
141
97
|
requirement: !ruby/object:Gem::Requirement
|
142
98
|
requirements:
|
143
99
|
- - ">="
|
144
100
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
101
|
+
version: '0.20'
|
146
102
|
type: :runtime
|
147
103
|
prerelease: false
|
148
104
|
version_requirements: !ruby/object:Gem::Requirement
|
149
105
|
requirements:
|
150
106
|
- - ">="
|
151
107
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
108
|
+
version: '0.20'
|
153
109
|
- !ruby/object:Gem::Dependency
|
154
110
|
name: waterdrop
|
155
111
|
requirement: !ruby/object:Gem::Requirement
|
156
112
|
requirements:
|
157
|
-
- - "
|
113
|
+
- - ">="
|
158
114
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
115
|
+
version: 2.2.0
|
116
|
+
- - "<"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 3.0.0
|
160
119
|
type: :runtime
|
161
120
|
prerelease: false
|
162
121
|
version_requirements: !ruby/object:Gem::Requirement
|
163
122
|
requirements:
|
164
|
-
- - "
|
123
|
+
- - ">="
|
165
124
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
125
|
+
version: 2.2.0
|
126
|
+
- - "<"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: 3.0.0
|
167
129
|
- !ruby/object:Gem::Dependency
|
168
130
|
name: zeitwerk
|
169
131
|
requirement: !ruby/object:Gem::Requirement
|
170
132
|
requirements:
|
171
133
|
- - "~>"
|
172
134
|
- !ruby/object:Gem::Version
|
173
|
-
version: '2.
|
135
|
+
version: '2.3'
|
174
136
|
type: :runtime
|
175
137
|
prerelease: false
|
176
138
|
version_requirements: !ruby/object:Gem::Requirement
|
177
139
|
requirements:
|
178
140
|
- - "~>"
|
179
141
|
- !ruby/object:Gem::Version
|
180
|
-
version: '2.
|
142
|
+
version: '2.3'
|
181
143
|
description: Framework used to simplify Apache Kafka based Ruby applications development
|
182
144
|
email:
|
183
145
|
- maciej@mensfeld.pl
|
184
|
-
- pavlo.vavruk@gmail.com
|
185
|
-
- adam99g@gmail.com
|
186
146
|
executables:
|
187
147
|
- karafka
|
188
148
|
extensions: []
|
@@ -191,6 +151,7 @@ files:
|
|
191
151
|
- ".coditsu/ci.yml"
|
192
152
|
- ".console_irbrc"
|
193
153
|
- ".diffend.yml"
|
154
|
+
- ".github/FUNDING.yml"
|
194
155
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
195
156
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
196
157
|
- ".github/workflows/ci.yml"
|
@@ -203,93 +164,110 @@ files:
|
|
203
164
|
- CONTRIBUTING.md
|
204
165
|
- Gemfile
|
205
166
|
- Gemfile.lock
|
206
|
-
-
|
167
|
+
- LICENSE
|
168
|
+
- LICENSE-COMM
|
169
|
+
- LICENSE-LGPL
|
207
170
|
- README.md
|
171
|
+
- bin/benchmarks
|
172
|
+
- bin/create_token
|
173
|
+
- bin/integrations
|
208
174
|
- bin/karafka
|
175
|
+
- bin/stress
|
176
|
+
- certs/karafka-pro.pem
|
209
177
|
- certs/mensfeld.pem
|
210
178
|
- config/errors.yml
|
211
179
|
- docker-compose.yml
|
212
180
|
- karafka.gemspec
|
181
|
+
- lib/active_job/karafka.rb
|
182
|
+
- lib/active_job/queue_adapters/karafka_adapter.rb
|
213
183
|
- lib/karafka.rb
|
184
|
+
- lib/karafka/active_job/consumer.rb
|
185
|
+
- lib/karafka/active_job/dispatcher.rb
|
186
|
+
- lib/karafka/active_job/job_extensions.rb
|
187
|
+
- lib/karafka/active_job/job_options_contract.rb
|
188
|
+
- lib/karafka/active_job/routing_extensions.rb
|
214
189
|
- lib/karafka/app.rb
|
215
|
-
- lib/karafka/assignment_strategies/round_robin.rb
|
216
|
-
- lib/karafka/attributes_map.rb
|
217
|
-
- lib/karafka/backends/inline.rb
|
218
190
|
- lib/karafka/base_consumer.rb
|
219
|
-
- lib/karafka/base_responder.rb
|
220
191
|
- lib/karafka/cli.rb
|
221
192
|
- lib/karafka/cli/base.rb
|
222
193
|
- lib/karafka/cli/console.rb
|
223
|
-
- lib/karafka/cli/flow.rb
|
224
194
|
- lib/karafka/cli/info.rb
|
225
195
|
- lib/karafka/cli/install.rb
|
226
|
-
- lib/karafka/cli/missingno.rb
|
227
196
|
- lib/karafka/cli/server.rb
|
228
|
-
- lib/karafka/code_reloader.rb
|
229
|
-
- lib/karafka/connection/api_adapter.rb
|
230
|
-
- lib/karafka/connection/batch_delegator.rb
|
231
|
-
- lib/karafka/connection/builder.rb
|
232
197
|
- lib/karafka/connection/client.rb
|
233
198
|
- lib/karafka/connection/listener.rb
|
234
|
-
- lib/karafka/connection/
|
235
|
-
- lib/karafka/
|
236
|
-
- lib/karafka/
|
237
|
-
- lib/karafka/consumers/includer.rb
|
238
|
-
- lib/karafka/consumers/responders.rb
|
239
|
-
- lib/karafka/consumers/single_params.rb
|
199
|
+
- lib/karafka/connection/messages_buffer.rb
|
200
|
+
- lib/karafka/connection/pauses_manager.rb
|
201
|
+
- lib/karafka/connection/rebalance_manager.rb
|
240
202
|
- lib/karafka/contracts.rb
|
203
|
+
- lib/karafka/contracts/base.rb
|
241
204
|
- lib/karafka/contracts/config.rb
|
242
205
|
- lib/karafka/contracts/consumer_group.rb
|
243
206
|
- lib/karafka/contracts/consumer_group_topic.rb
|
244
|
-
- lib/karafka/contracts/responder_usage.rb
|
245
207
|
- lib/karafka/contracts/server_cli_options.rb
|
208
|
+
- lib/karafka/env.rb
|
246
209
|
- lib/karafka/errors.rb
|
247
|
-
- lib/karafka/fetcher.rb
|
248
|
-
- lib/karafka/helpers/class_matcher.rb
|
249
|
-
- lib/karafka/helpers/config_retriever.rb
|
250
|
-
- lib/karafka/helpers/inflector.rb
|
251
210
|
- lib/karafka/helpers/multi_delegator.rb
|
211
|
+
- lib/karafka/instrumentation.rb
|
212
|
+
- lib/karafka/instrumentation/callbacks/error.rb
|
213
|
+
- lib/karafka/instrumentation/callbacks/statistics.rb
|
252
214
|
- lib/karafka/instrumentation/logger.rb
|
253
215
|
- lib/karafka/instrumentation/monitor.rb
|
254
216
|
- lib/karafka/instrumentation/proctitle_listener.rb
|
255
217
|
- lib/karafka/instrumentation/stdout_listener.rb
|
256
|
-
- lib/karafka/
|
257
|
-
- lib/karafka/
|
258
|
-
- lib/karafka/
|
259
|
-
- lib/karafka/
|
260
|
-
- lib/karafka/
|
261
|
-
- lib/karafka/
|
262
|
-
- lib/karafka/
|
263
|
-
- lib/karafka/
|
264
|
-
- lib/karafka/
|
265
|
-
- lib/karafka/
|
266
|
-
- lib/karafka/
|
218
|
+
- lib/karafka/licenser.rb
|
219
|
+
- lib/karafka/messages/batch_metadata.rb
|
220
|
+
- lib/karafka/messages/builders/batch_metadata.rb
|
221
|
+
- lib/karafka/messages/builders/message.rb
|
222
|
+
- lib/karafka/messages/builders/messages.rb
|
223
|
+
- lib/karafka/messages/message.rb
|
224
|
+
- lib/karafka/messages/messages.rb
|
225
|
+
- lib/karafka/messages/metadata.rb
|
226
|
+
- lib/karafka/messages/seek.rb
|
227
|
+
- lib/karafka/patches/rdkafka/consumer.rb
|
228
|
+
- lib/karafka/pro.rb
|
229
|
+
- lib/karafka/pro/active_job/dispatcher.rb
|
230
|
+
- lib/karafka/pro/active_job/job_options_contract.rb
|
231
|
+
- lib/karafka/pro/loader.rb
|
267
232
|
- lib/karafka/process.rb
|
268
|
-
- lib/karafka/
|
269
|
-
- lib/karafka/
|
233
|
+
- lib/karafka/processing/executor.rb
|
234
|
+
- lib/karafka/processing/executors_buffer.rb
|
235
|
+
- lib/karafka/processing/jobs/base.rb
|
236
|
+
- lib/karafka/processing/jobs/consume.rb
|
237
|
+
- lib/karafka/processing/jobs/revoked.rb
|
238
|
+
- lib/karafka/processing/jobs/shutdown.rb
|
239
|
+
- lib/karafka/processing/jobs_queue.rb
|
240
|
+
- lib/karafka/processing/worker.rb
|
241
|
+
- lib/karafka/processing/workers_batch.rb
|
242
|
+
- lib/karafka/railtie.rb
|
270
243
|
- lib/karafka/routing/builder.rb
|
271
244
|
- lib/karafka/routing/consumer_group.rb
|
272
245
|
- lib/karafka/routing/consumer_mapper.rb
|
273
246
|
- lib/karafka/routing/proxy.rb
|
274
247
|
- lib/karafka/routing/router.rb
|
248
|
+
- lib/karafka/routing/subscription_group.rb
|
249
|
+
- lib/karafka/routing/subscription_groups_builder.rb
|
275
250
|
- lib/karafka/routing/topic.rb
|
276
|
-
- lib/karafka/
|
251
|
+
- lib/karafka/runner.rb
|
277
252
|
- lib/karafka/serialization/json/deserializer.rb
|
278
|
-
- lib/karafka/serialization/json/serializer.rb
|
279
253
|
- lib/karafka/server.rb
|
280
254
|
- lib/karafka/setup/config.rb
|
281
|
-
- lib/karafka/setup/configurators/water_drop.rb
|
282
255
|
- lib/karafka/setup/dsl.rb
|
283
256
|
- lib/karafka/status.rb
|
284
257
|
- lib/karafka/templates/application_consumer.rb.erb
|
285
|
-
- lib/karafka/templates/
|
258
|
+
- lib/karafka/templates/example_consumer.rb.erb
|
286
259
|
- lib/karafka/templates/karafka.rb.erb
|
260
|
+
- lib/karafka/time_trackers/base.rb
|
261
|
+
- lib/karafka/time_trackers/pause.rb
|
262
|
+
- lib/karafka/time_trackers/poll.rb
|
287
263
|
- lib/karafka/version.rb
|
288
264
|
- log/.gitkeep
|
289
|
-
homepage: https://
|
265
|
+
homepage: https://karafka.io
|
290
266
|
licenses:
|
291
|
-
-
|
292
|
-
metadata:
|
267
|
+
- LGPL-3.0
|
268
|
+
metadata:
|
269
|
+
source_code_uri: https://github.com/karafka/karafka
|
270
|
+
rubygems_mfa_required: 'true'
|
293
271
|
post_install_message:
|
294
272
|
rdoc_options: []
|
295
273
|
require_paths:
|
@@ -301,11 +279,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
301
279
|
version: 2.6.0
|
302
280
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
303
281
|
requirements:
|
304
|
-
- - "
|
282
|
+
- - ">"
|
305
283
|
- !ruby/object:Gem::Version
|
306
|
-
version:
|
284
|
+
version: 1.3.1
|
307
285
|
requirements: []
|
308
|
-
rubygems_version: 3.
|
286
|
+
rubygems_version: 3.3.3
|
309
287
|
signing_key:
|
310
288
|
specification_version: 4
|
311
289
|
summary: Ruby based framework for working with Apache Kafka
|
metadata.gz.sig
CHANGED
Binary file
|
data/MIT-LICENCE
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
2
|
-
a copy of this software and associated documentation files (the
|
3
|
-
"Software"), to deal in the Software without restriction, including
|
4
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
5
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
6
|
-
permit persons to whom the Software is furnished to do so, subject to
|
7
|
-
the following conditions:
|
8
|
-
|
9
|
-
The above copyright notice and this permission notice shall be
|
10
|
-
included in all copies or substantial portions of the Software.
|
11
|
-
|
12
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
13
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
14
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
15
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
16
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
17
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
18
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Karafka
|
4
|
-
# Strategies for Kafka partitions assignments
|
5
|
-
module AssignmentStrategies
|
6
|
-
# Standard RoundRobin strategy
|
7
|
-
class RoundRobin < SimpleDelegator
|
8
|
-
def initialize
|
9
|
-
super(Kafka::RoundRobinAssignmentStrategy.new)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Karafka
|
4
|
-
# Both Karafka and Ruby-Kafka contain a lot of settings that can be applied on multiple
|
5
|
-
# levels. In Karafka that is on consumer group and on the topic level. In Ruby-Kafka it
|
6
|
-
# is on consumer, subscription and consumption levels. In order to maintain an order
|
7
|
-
# in managing those settings, this module was created. It contains details on what setting
|
8
|
-
# where should go and which layer (both on Karafka and Ruby-Kafka) is responsible for
|
9
|
-
# setting it and sending it forward
|
10
|
-
# @note Settings presented here cover all the settings that are being used across Karafka
|
11
|
-
module AttributesMap
|
12
|
-
class << self
|
13
|
-
# What settings should go where in ruby-kafka
|
14
|
-
# @return [Hash] hash with proper sections on what to proxy where in Ruby-Kafka
|
15
|
-
# @note All other settings will be passed to Kafka.new method invocation.
|
16
|
-
# All elements in this hash are just edge cases
|
17
|
-
def api_adapter
|
18
|
-
{
|
19
|
-
consumer: %i[
|
20
|
-
session_timeout offset_commit_interval offset_commit_threshold
|
21
|
-
offset_retention_time heartbeat_interval fetcher_max_queue_size
|
22
|
-
assignment_strategy
|
23
|
-
],
|
24
|
-
subscribe: %i[start_from_beginning max_bytes_per_partition],
|
25
|
-
consumption: %i[min_bytes max_bytes max_wait_time],
|
26
|
-
pause: %i[pause_timeout pause_max_timeout pause_exponential_backoff],
|
27
|
-
# All the options that are under kafka config namespace, but are not used
|
28
|
-
# directly with kafka api, but from the Karafka user perspective, they are
|
29
|
-
# still related to kafka. They should not be proxied anywhere
|
30
|
-
ignored: %i[reconnect_timeout automatically_mark_as_consumed]
|
31
|
-
}
|
32
|
-
end
|
33
|
-
|
34
|
-
# @return [Array<Symbol>] properties that can be set on a per topic level
|
35
|
-
def topic
|
36
|
-
(api_adapter[:subscribe] + %i[
|
37
|
-
backend
|
38
|
-
name
|
39
|
-
deserializer
|
40
|
-
responder
|
41
|
-
batch_consuming
|
42
|
-
]).uniq
|
43
|
-
end
|
44
|
-
|
45
|
-
# @return [Array<Symbol>] properties that can be set on a per consumer group level
|
46
|
-
# @note Note that there are settings directly extracted from the config kafka namespace
|
47
|
-
# I did this that way, so I won't have to repeat same setting keys over and over again
|
48
|
-
# Thanks to this solution, if any new setting is available for ruby-kafka, we just need
|
49
|
-
# to add it to our configuration class and it will be handled automatically.
|
50
|
-
def consumer_group
|
51
|
-
# @note We don't ignore the api_adapter[:ignored] values as they should be ignored
|
52
|
-
# only when proxying details go ruby-kafka. We use ignored fields internally in karafka
|
53
|
-
ignored_settings = api_adapter[:subscribe]
|
54
|
-
defined_settings = api_adapter.values.flatten
|
55
|
-
karafka_settings = %i[batch_fetching]
|
56
|
-
|
57
|
-
dynamically_proxied = Karafka::Setup::Config.config.kafka.to_h.keys
|
58
|
-
|
59
|
-
(defined_settings + dynamically_proxied).uniq + karafka_settings - ignored_settings
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Karafka
|
4
|
-
# Namespace for all different backends Karafka supports
|
5
|
-
module Backends
|
6
|
-
# Backend that just runs stuff asap without any scheduling
|
7
|
-
module Inline
|
8
|
-
private
|
9
|
-
|
10
|
-
# Executes consume code immediately (without enqueuing)
|
11
|
-
def process
|
12
|
-
Karafka.monitor.instrument('backends.inline.process', caller: self) { consume }
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|