karafka 1.3.5 → 1.4.0
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.tar.gz.sig +0 -0
- data/.diffend.yml +3 -0
- data/.github/workflows/ci.yml +52 -0
- data/CHANGELOG.md +27 -1
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +32 -33
- data/README.md +3 -5
- data/certs/mensfeld.pem +21 -21
- data/docker-compose.yml +17 -0
- data/karafka.gemspec +3 -4
- data/lib/karafka.rb +1 -1
- data/lib/karafka/cli.rb +1 -1
- data/lib/karafka/cli/flow.rb +9 -10
- data/lib/karafka/cli/info.rb +1 -1
- data/lib/karafka/connection/api_adapter.rb +12 -6
- data/lib/karafka/connection/batch_delegator.rb +5 -1
- data/lib/karafka/connection/builder.rb +4 -2
- data/lib/karafka/connection/client.rb +1 -1
- data/lib/karafka/consumers/batch_metadata.rb +10 -0
- data/lib/karafka/consumers/includer.rb +5 -4
- data/lib/karafka/instrumentation/stdout_listener.rb +4 -2
- data/lib/karafka/params/batch_metadata.rb +26 -0
- data/lib/karafka/params/builders/batch_metadata.rb +30 -0
- data/lib/karafka/params/builders/params.rb +17 -15
- data/lib/karafka/params/builders/params_batch.rb +2 -2
- data/lib/karafka/params/metadata.rb +14 -29
- data/lib/karafka/params/params.rb +27 -41
- data/lib/karafka/params/params_batch.rb +15 -16
- data/lib/karafka/serialization/json/deserializer.rb +2 -2
- data/lib/karafka/setup/config.rb +2 -0
- data/lib/karafka/version.rb +1 -1
- metadata +35 -46
- metadata.gz.sig +0 -0
- data/.travis.yml +0 -36
- data/lib/karafka/consumers/metadata.rb +0 -10
- data/lib/karafka/params/builders/metadata.rb +0 -33
@@ -17,8 +17,8 @@ module Karafka
|
|
17
17
|
# }
|
18
18
|
# Deserializer.call(params) #=> { 'a' => 1 }
|
19
19
|
def call(params)
|
20
|
-
::
|
21
|
-
rescue ::
|
20
|
+
params.raw_payload.nil? ? nil : ::JSON.parse(params.raw_payload)
|
21
|
+
rescue ::JSON::ParserError => e
|
22
22
|
raise ::Karafka::Errors::DeserializationError, e
|
23
23
|
end
|
24
24
|
end
|
data/lib/karafka/setup/config.rb
CHANGED
@@ -124,6 +124,8 @@ module Karafka
|
|
124
124
|
# will be killed. Note that some Kafka operations are by definition long-running, such as
|
125
125
|
# waiting for new messages to arrive in a partition, so don't set this value too low
|
126
126
|
setting :socket_timeout, 30
|
127
|
+
# option partitioner [Object, nil] the partitioner that should be used by the client
|
128
|
+
setting :partitioner, nil
|
127
129
|
|
128
130
|
# SSL authentication related settings
|
129
131
|
# option ca_cert [String, nil] SSL CA certificate
|
data/lib/karafka/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -13,30 +13,30 @@ cert_chain:
|
|
13
13
|
- |
|
14
14
|
-----BEGIN CERTIFICATE-----
|
15
15
|
MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhtYWNp
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
16
|
+
ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMjAwODExMDkxNTM3WhcNMjEwODExMDkx
|
17
|
+
NTM3WjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
|
18
|
+
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDCpXsCgmINb6lHBXXBdyrgsBPSxC4/
|
19
|
+
2H+weJ6L9CruTiv2+2/ZkQGtnLcDgrD14rdLIHK7t0o3EKYlDT5Gh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bCzX8EA6VY0khEvnmiq7S6eBF0H9qH8KyQ6
|
34
|
+
EkVLpvmUDFcf/uNaBQdazEMB5jYtwoA8gQlANETNGPi51KlkukhKgaIEDMkBDJOx
|
35
|
+
65N7DzmkcyY0/GwjIVIxmRhcrCt1YeCUElmfFx0iida1/YRm6sB2AXqScc1+ECRi
|
36
|
+
2DND//YJUikn1zwbz1kT70XmHd97B4Eytpln7K+M1u2g1pHVEPW4owD/ammXNpUy
|
37
|
+
nt70FcDD4yxJQ+0YNiHd0N8IcVBM1TMIVctMNQ==
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2020-
|
39
|
+
date: 2020-09-05 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: dry-configurable
|
@@ -122,20 +122,6 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '1.0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: multi_json
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '1.12'
|
132
|
-
type: :runtime
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '1.12'
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: rake
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +142,14 @@ dependencies:
|
|
156
142
|
requirements:
|
157
143
|
- - ">="
|
158
144
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
145
|
+
version: 1.0.0
|
160
146
|
type: :runtime
|
161
147
|
prerelease: false
|
162
148
|
version_requirements: !ruby/object:Gem::Requirement
|
163
149
|
requirements:
|
164
150
|
- - ">="
|
165
151
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.
|
152
|
+
version: 1.0.0
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: thor
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +170,14 @@ dependencies:
|
|
184
170
|
requirements:
|
185
171
|
- - "~>"
|
186
172
|
- !ruby/object:Gem::Version
|
187
|
-
version: 1.
|
173
|
+
version: 1.4.0
|
188
174
|
type: :runtime
|
189
175
|
prerelease: false
|
190
176
|
version_requirements: !ruby/object:Gem::Requirement
|
191
177
|
requirements:
|
192
178
|
- - "~>"
|
193
179
|
- !ruby/object:Gem::Version
|
194
|
-
version: 1.
|
180
|
+
version: 1.4.0
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
182
|
name: zeitwerk
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,7 +194,7 @@ dependencies:
|
|
208
194
|
version: '2.1'
|
209
195
|
description: Framework used to simplify Apache Kafka based Ruby applications development
|
210
196
|
email:
|
211
|
-
- maciej@
|
197
|
+
- maciej@mensfeld.pl
|
212
198
|
- pavlo.vavruk@gmail.com
|
213
199
|
- adam99g@gmail.com
|
214
200
|
executables:
|
@@ -218,14 +204,15 @@ extra_rdoc_files: []
|
|
218
204
|
files:
|
219
205
|
- ".coditsu/ci.yml"
|
220
206
|
- ".console_irbrc"
|
207
|
+
- ".diffend.yml"
|
221
208
|
- ".github/FUNDING.yml"
|
222
209
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
223
210
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
211
|
+
- ".github/workflows/ci.yml"
|
224
212
|
- ".gitignore"
|
225
213
|
- ".rspec"
|
226
214
|
- ".ruby-gemset"
|
227
215
|
- ".ruby-version"
|
228
|
-
- ".travis.yml"
|
229
216
|
- CHANGELOG.md
|
230
217
|
- CODE_OF_CONDUCT.md
|
231
218
|
- CONTRIBUTING.md
|
@@ -236,6 +223,7 @@ files:
|
|
236
223
|
- bin/karafka
|
237
224
|
- certs/mensfeld.pem
|
238
225
|
- config/errors.yml
|
226
|
+
- docker-compose.yml
|
239
227
|
- karafka.gemspec
|
240
228
|
- lib/karafka.rb
|
241
229
|
- lib/karafka/app.rb
|
@@ -257,9 +245,9 @@ files:
|
|
257
245
|
- lib/karafka/connection/client.rb
|
258
246
|
- lib/karafka/connection/listener.rb
|
259
247
|
- lib/karafka/connection/message_delegator.rb
|
248
|
+
- lib/karafka/consumers/batch_metadata.rb
|
260
249
|
- lib/karafka/consumers/callbacks.rb
|
261
250
|
- lib/karafka/consumers/includer.rb
|
262
|
-
- lib/karafka/consumers/metadata.rb
|
263
251
|
- lib/karafka/consumers/responders.rb
|
264
252
|
- lib/karafka/consumers/single_params.rb
|
265
253
|
- lib/karafka/contracts.rb
|
@@ -278,7 +266,8 @@ files:
|
|
278
266
|
- lib/karafka/instrumentation/monitor.rb
|
279
267
|
- lib/karafka/instrumentation/proctitle_listener.rb
|
280
268
|
- lib/karafka/instrumentation/stdout_listener.rb
|
281
|
-
- lib/karafka/params/
|
269
|
+
- lib/karafka/params/batch_metadata.rb
|
270
|
+
- lib/karafka/params/builders/batch_metadata.rb
|
282
271
|
- lib/karafka/params/builders/params.rb
|
283
272
|
- lib/karafka/params/builders/params_batch.rb
|
284
273
|
- lib/karafka/params/metadata.rb
|
@@ -329,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
318
|
- !ruby/object:Gem::Version
|
330
319
|
version: '0'
|
331
320
|
requirements: []
|
332
|
-
rubygems_version: 3.1.
|
321
|
+
rubygems_version: 3.1.4
|
333
322
|
signing_key:
|
334
323
|
specification_version: 4
|
335
324
|
summary: Ruby based framework for working with Apache Kafka
|
metadata.gz.sig
CHANGED
Binary file
|
data/.travis.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
services:
|
2
|
-
- docker
|
3
|
-
|
4
|
-
dist: trusty
|
5
|
-
sudo: false
|
6
|
-
cache: bundler
|
7
|
-
|
8
|
-
git:
|
9
|
-
depth: false
|
10
|
-
|
11
|
-
test: &test
|
12
|
-
stage: Test
|
13
|
-
language: ruby
|
14
|
-
before_install:
|
15
|
-
- yes | gem update --system
|
16
|
-
script: bundle exec rspec
|
17
|
-
|
18
|
-
jobs:
|
19
|
-
include:
|
20
|
-
- <<: *test
|
21
|
-
rvm: 2.7.1
|
22
|
-
- <<: *test
|
23
|
-
rvm: 2.6.6
|
24
|
-
- <<: *test
|
25
|
-
rvm: 2.5.8
|
26
|
-
|
27
|
-
- stage: coditsu
|
28
|
-
language: ruby
|
29
|
-
rvm: 2.7.1
|
30
|
-
before_install:
|
31
|
-
- yes | gem update --system
|
32
|
-
script: \curl -sSL https://api.coditsu.io/run/ci | bash
|
33
|
-
|
34
|
-
stages:
|
35
|
-
- test
|
36
|
-
- coditsu
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Karafka
|
4
|
-
module Params
|
5
|
-
module Builders
|
6
|
-
# Builder for creating metadata object based on the message or batch informations
|
7
|
-
# @note We have 2 ways of creating metadata based on the way ruby-kafka operates
|
8
|
-
module Metadata
|
9
|
-
class << self
|
10
|
-
# Creates metadata based on the kafka batch data
|
11
|
-
# @param kafka_batch [Kafka::FetchedBatch] kafka batch details
|
12
|
-
# @param topic [Karafka::Routing::Topic] topic for which we've fetched the batch
|
13
|
-
# @return [Karafka::Params::Metadata] metadata object
|
14
|
-
def from_kafka_batch(kafka_batch, topic)
|
15
|
-
Karafka::Params::Metadata
|
16
|
-
.new
|
17
|
-
.merge!(
|
18
|
-
'batch_size' => kafka_batch.messages.count,
|
19
|
-
'first_offset' => kafka_batch.first_offset,
|
20
|
-
'highwater_mark_offset' => kafka_batch.highwater_mark_offset,
|
21
|
-
'last_offset' => kafka_batch.last_offset,
|
22
|
-
'offset_lag' => kafka_batch.offset_lag,
|
23
|
-
'deserializer' => topic.deserializer,
|
24
|
-
'partition' => kafka_batch.partition,
|
25
|
-
'topic' => kafka_batch.topic,
|
26
|
-
'unknown_last_offset' => kafka_batch.unknown_last_offset?
|
27
|
-
)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|