karafka 1.3.5 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,8 +17,8 @@ module Karafka
17
17
  # }
18
18
  # Deserializer.call(params) #=> { 'a' => 1 }
19
19
  def call(params)
20
- ::MultiJson.load(params['payload'])
21
- rescue ::MultiJson::ParseError => e
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
@@ -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
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '1.3.5'
6
+ VERSION = '1.4.0'
7
7
  end
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.3.5
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
- ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMTkwNzMwMTQ1NDU0WhcNMjAwNzI5MTQ1
17
- NDU0WjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
18
- CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC9fCwtaHZG2SyyNXiH8r0QbJQx/xxl
19
- dkvwWz9QGJO+O8r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iHpwoENVrMi94V1zD4o8/6G3AU
30
+ gWz4udkPYHTZLUy3dLznc/sNjdkJFWT3E6NKYq7c60EpJ0m0vAEg5+F5pmNOsvD3
31
+ 2pXLj9kisEeYhR516HwXAvtngboUcb75skqvBCU++4Pu7BRAPjO1/ihLSBexbwSS
32
+ fF+J5OWNuyHHCQp+kGPLtXJe2yUYyvSWDj3I2//Vk0VhNOIlaCS1+5/P3ZJThOtm
33
+ zJUBI7h3HgovwRpcnmk2mXTmU4Zx/bCzX8EA6VY0khEvnmiq7S6eBF0H9qH8KyQ6
34
+ EkVLpvmUDFcf/uNaBQdazEMB5jYtwoA8gQlANETNGPi51KlkukhKgaIEDMkBDJOx
35
+ 65N7DzmkcyY0/GwjIVIxmRhcrCt1YeCUElmfFx0iida1/YRm6sB2AXqScc1+ECRi
36
+ 2DND//YJUikn1zwbz1kT70XmHd97B4Eytpln7K+M1u2g1pHVEPW4owD/ammXNpUy
37
+ nt70FcDD4yxJQ+0YNiHd0N8IcVBM1TMIVctMNQ==
38
38
  -----END CERTIFICATE-----
39
- date: 2020-04-03 00:00:00.000000000 Z
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.7.8
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.7.8
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.3.0
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.3.0
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@coditsu.io
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/builders/metadata.rb
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.2
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
@@ -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,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Karafka
4
- module Consumers
5
- # Brings the metadata into consumers that support batch_fetching
6
- module Metadata
7
- attr_accessor :metadata
8
- end
9
- end
10
- end
@@ -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