karafka-sidekiq-backend 1.4.1 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 312e0d875d82f787bcc0bcbeb62800848854ca48edecc4f32adc2f6d197933c6
4
- data.tar.gz: c9f8025e140d01b6f265183c8deb587d472d83bba65d0775b30acc655764764c
3
+ metadata.gz: 4c4560c74ccb09e782379a950507c3989adef5c3be5415beeeb2003b9d641768
4
+ data.tar.gz: 22422624c731faa13641adf08a36cd067913826358a57a38e45f8a5a5be553af
5
5
  SHA512:
6
- metadata.gz: '081a0362985daa3d7184934305cdaa9f5855175885fa66a30ad50d703d9ab68bea30c89ec43e538af0c53e941e12c2395f3e2c5dce3b2c1de2d6c39f86834187'
7
- data.tar.gz: 5cd8df15cc8645e9f688b5bfd89d050db06542f04079bbee7c8f4fbc944a726ca5a4122e0b928a0ef58b1b60922d35c4af63b2cd20c6559cb101f4a72d1aef9f
6
+ metadata.gz: 0ec03fbc6ece2e0664e61d44de00b30f3e0690cb0d3bc8e15eceb9af73b33272264927b8fccb025c742911fa4b506360a5bb7d1536e85f9ed2421a9ba78405ce
7
+ data.tar.gz: 5222810dc912bde65da7db269e07d3556a850e471b3b02217fba07764590e6673e3f975bbe7e697f2204668d24cc518ff97eae20b7d684803208b35a4017a8bb
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,6 +1,9 @@
1
1
  name: ci
2
2
 
3
+ concurrency: ci-${{ github.ref }}
4
+
3
5
  on:
6
+ pull_request:
4
7
  push:
5
8
  schedule:
6
9
  - cron: '0 1 * * *'
@@ -8,15 +11,16 @@ on:
8
11
  jobs:
9
12
  specs:
10
13
  runs-on: ubuntu-latest
14
+ needs: diffend
11
15
  strategy:
12
16
  fail-fast: false
13
17
  matrix:
14
18
  ruby:
19
+ - '3.1'
20
+ - '3.0'
15
21
  - '2.7'
16
- - '2.6'
17
- - '2.5'
18
22
  include:
19
- - ruby: '2.7'
23
+ - ruby: '3.1'
20
24
  coverage: 'true'
21
25
  steps:
22
26
  - uses: actions/checkout@v2
@@ -36,6 +40,26 @@ jobs:
36
40
  env:
37
41
  GITHUB_COVERAGE: ${{matrix.coverage}}
38
42
  run: bundle exec rspec
43
+
44
+ diffend:
45
+ runs-on: ubuntu-latest
46
+ strategy:
47
+ fail-fast: false
48
+ steps:
49
+ - uses: actions/checkout@v2
50
+ with:
51
+ fetch-depth: 0
52
+ - name: Set up Ruby
53
+ uses: ruby/setup-ruby@v1
54
+ with:
55
+ ruby-version: 3.1
56
+ - name: Install latest bundler
57
+ run: gem install bundler --no-document
58
+ - name: Install Diffend plugin
59
+ run: bundle plugin install diffend
60
+ - name: Bundle Secure
61
+ run: bundle secure
62
+
39
63
  coditsu:
40
64
  runs-on: ubuntu-latest
41
65
  strategy:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 3.1.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Karafka Sidekiq Backend
2
2
 
3
+ ## 1.4.4 (2022-03-06)
4
+ - Ruby 3.1 support
5
+ - Drop support for Ruby 2.6
6
+ - Fix unsafe JSON serialization issued by Sidekiq (#122)
7
+ - Provide sub-second precision for data processed in Sidekiq
8
+
9
+ ## 1.4.3 (2021-12-05)
10
+ - Source code metadata url added to the gemspec
11
+
12
+ ## 1.4.2 (2021-04-21)
13
+ - Remove Ruby 2.5 support and update minimum Ruby requirement to 2.6
14
+
3
15
  ## 1.4.1 (2020-27-10)
4
16
  - Corrected interchanger documentation (Jack12816)
5
17
  - Corrected the interchanger key reference (Jack12816)
data/Gemfile.lock CHANGED
@@ -1,127 +1,114 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-sidekiq-backend (1.4.1)
4
+ karafka-sidekiq-backend (1.4.4)
5
5
  karafka (~> 1.4.0)
6
6
  sidekiq (>= 4.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- concurrent-ruby (1.1.7)
12
- connection_pool (2.2.3)
13
- delivery_boy (1.0.1)
14
- king_konf (~> 0.3)
11
+ concurrent-ruby (1.1.9)
12
+ connection_pool (2.2.5)
13
+ delivery_boy (1.1.0)
14
+ king_konf (~> 1.0)
15
15
  ruby-kafka (~> 1.0)
16
- diff-lcs (1.4.4)
17
- digest-crc (0.6.1)
18
- rake (~> 13.0)
19
- docile (1.3.2)
20
- dry-configurable (0.11.6)
16
+ diff-lcs (1.5.0)
17
+ digest-crc (0.6.4)
18
+ rake (>= 12.0.0, < 14.0.0)
19
+ docile (1.4.0)
20
+ dry-configurable (0.14.0)
21
21
  concurrent-ruby (~> 1.0)
22
- dry-core (~> 0.4, >= 0.4.7)
23
- dry-equalizer (~> 0.2)
24
- dry-container (0.7.2)
22
+ dry-core (~> 0.6)
23
+ dry-container (0.9.0)
25
24
  concurrent-ruby (~> 1.0)
26
- dry-configurable (~> 0.1, >= 0.1.3)
27
- dry-core (0.4.9)
25
+ dry-configurable (~> 0.13, >= 0.13.0)
26
+ dry-core (0.7.1)
28
27
  concurrent-ruby (~> 1.0)
29
- dry-equalizer (0.3.0)
30
- dry-events (0.2.0)
28
+ dry-events (0.3.0)
31
29
  concurrent-ruby (~> 1.0)
32
- dry-core (~> 0.4)
33
- dry-equalizer (~> 0.2)
34
- dry-inflector (0.2.0)
35
- dry-initializer (3.0.4)
36
- dry-logic (1.0.8)
30
+ dry-core (~> 0.5, >= 0.5)
31
+ dry-inflector (0.2.1)
32
+ dry-initializer (3.1.1)
33
+ dry-logic (1.2.0)
37
34
  concurrent-ruby (~> 1.0)
38
- dry-core (~> 0.2)
39
- dry-equalizer (~> 0.2)
40
- dry-monitor (0.3.2)
41
- dry-configurable (~> 0.5)
42
- dry-core (~> 0.4)
43
- dry-equalizer (~> 0.2)
35
+ dry-core (~> 0.5, >= 0.5)
36
+ dry-monitor (0.5.0)
37
+ dry-configurable (~> 0.13, >= 0.13.0)
38
+ dry-core (~> 0.5, >= 0.5)
44
39
  dry-events (~> 0.2)
45
- dry-schema (1.5.6)
40
+ dry-schema (1.9.1)
46
41
  concurrent-ruby (~> 1.0)
47
- dry-configurable (~> 0.8, >= 0.8.3)
48
- dry-core (~> 0.4)
49
- dry-equalizer (~> 0.2)
42
+ dry-configurable (~> 0.13, >= 0.13.0)
43
+ dry-core (~> 0.5, >= 0.5)
50
44
  dry-initializer (~> 3.0)
51
45
  dry-logic (~> 1.0)
52
- dry-types (~> 1.4)
53
- dry-types (1.4.0)
46
+ dry-types (~> 1.5)
47
+ dry-types (1.5.1)
54
48
  concurrent-ruby (~> 1.0)
55
49
  dry-container (~> 0.3)
56
- dry-core (~> 0.4, >= 0.4.4)
57
- dry-equalizer (~> 0.3)
50
+ dry-core (~> 0.5, >= 0.5)
58
51
  dry-inflector (~> 0.1, >= 0.1.2)
59
52
  dry-logic (~> 1.0, >= 1.0.2)
60
- dry-validation (1.5.6)
53
+ dry-validation (1.8.0)
61
54
  concurrent-ruby (~> 1.0)
62
55
  dry-container (~> 0.7, >= 0.7.1)
63
- dry-core (~> 0.4)
64
- dry-equalizer (~> 0.2)
56
+ dry-core (~> 0.5, >= 0.5)
65
57
  dry-initializer (~> 3.0)
66
- dry-schema (~> 1.5, >= 1.5.2)
67
- envlogic (1.1.2)
58
+ dry-schema (~> 1.9, >= 1.9.1)
59
+ envlogic (1.1.4)
68
60
  dry-inflector (~> 0.1)
69
- io-console (0.5.6)
70
- irb (1.2.7)
71
- reline (>= 0.1.5)
72
- karafka (1.4.0)
73
- dry-configurable (~> 0.8)
74
- dry-inflector (~> 0.1)
75
- dry-monitor (~> 0.3)
76
- dry-validation (~> 1.2)
61
+ karafka (1.4.13)
62
+ dry-configurable (~> 0.13)
63
+ dry-inflector (~> 0.2)
64
+ dry-monitor (~> 0.5)
65
+ dry-validation (~> 1.7)
77
66
  envlogic (~> 1.1)
78
- irb (~> 1.0)
79
- rake (>= 11.3)
80
- ruby-kafka (>= 1.0.0)
81
- thor (>= 0.20)
82
- waterdrop (~> 1.4.0)
83
- zeitwerk (~> 2.1)
84
- king_konf (0.3.7)
67
+ ruby-kafka (>= 1.3.0)
68
+ thor (>= 1.1)
69
+ waterdrop (~> 1.4)
70
+ zeitwerk (~> 2.4)
71
+ king_konf (1.0.0)
85
72
  rack (2.2.3)
86
- rake (13.0.1)
87
- redis (4.2.2)
88
- reline (0.1.6)
89
- io-console (~> 0.5)
90
- rspec (3.9.0)
91
- rspec-core (~> 3.9.0)
92
- rspec-expectations (~> 3.9.0)
93
- rspec-mocks (~> 3.9.0)
94
- rspec-core (3.9.3)
95
- rspec-support (~> 3.9.3)
96
- rspec-expectations (3.9.3)
73
+ rake (13.0.6)
74
+ redis (4.6.0)
75
+ rspec (3.11.0)
76
+ rspec-core (~> 3.11.0)
77
+ rspec-expectations (~> 3.11.0)
78
+ rspec-mocks (~> 3.11.0)
79
+ rspec-core (3.11.0)
80
+ rspec-support (~> 3.11.0)
81
+ rspec-expectations (3.11.0)
97
82
  diff-lcs (>= 1.2.0, < 2.0)
98
- rspec-support (~> 3.9.0)
99
- rspec-mocks (3.9.1)
83
+ rspec-support (~> 3.11.0)
84
+ rspec-mocks (3.11.0)
100
85
  diff-lcs (>= 1.2.0, < 2.0)
101
- rspec-support (~> 3.9.0)
102
- rspec-support (3.9.4)
103
- ruby-kafka (1.3.0)
86
+ rspec-support (~> 3.11.0)
87
+ rspec-support (3.11.0)
88
+ ruby-kafka (1.4.0)
104
89
  digest-crc
105
- sidekiq (6.1.2)
90
+ sidekiq (6.4.1)
106
91
  connection_pool (>= 2.2.2)
107
92
  rack (~> 2.0)
108
93
  redis (>= 4.2.0)
109
- simplecov (0.19.0)
94
+ simplecov (0.21.2)
110
95
  docile (~> 1.1)
111
96
  simplecov-html (~> 0.11)
97
+ simplecov_json_formatter (~> 0.1)
112
98
  simplecov-html (0.12.3)
113
- thor (1.0.1)
114
- waterdrop (1.4.0)
99
+ simplecov_json_formatter (0.1.4)
100
+ thor (1.2.1)
101
+ waterdrop (1.4.4)
115
102
  delivery_boy (>= 0.2, < 2.x)
116
- dry-configurable (~> 0.8)
117
- dry-monitor (~> 0.3)
118
- dry-validation (~> 1.2)
119
- ruby-kafka (>= 0.7.8)
120
- zeitwerk (~> 2.1)
121
- zeitwerk (2.4.0)
103
+ dry-configurable (~> 0.13)
104
+ dry-monitor (~> 0.5)
105
+ dry-validation (~> 1.7)
106
+ ruby-kafka (>= 1.3.0)
107
+ zeitwerk (~> 2.4)
108
+ zeitwerk (2.5.4)
122
109
 
123
110
  PLATFORMS
124
- ruby
111
+ x86_64-linux
125
112
 
126
113
  DEPENDENCIES
127
114
  karafka-sidekiq-backend!
@@ -129,4 +116,4 @@ DEPENDENCIES
129
116
  simplecov
130
117
 
131
118
  BUNDLED WITH
132
- 2.1.4
119
+ 2.3.7
data/MIT-LICENSE ADDED
@@ -0,0 +1,18 @@
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.
data/README.md CHANGED
@@ -1,7 +1,16 @@
1
1
  # Karafka Sidekiq Backend
2
2
 
3
+ ## Deprecation notice
4
+
5
+ This backend was designed to compensate for lack of multi-threading in Karafka. After Karafka `2.0` release, this backend development won't be continued.
6
+
7
+ We will **still** support it for Karafka `1.4` but it won't work with Karafka `2.0`. We will however provide an extensive guide on how you can achieve similar functionality with Sidekiq yourself.
8
+
9
+ ## About
10
+
3
11
  [![Build Status](https://github.com/karafka/sidekiq-backend/workflows/ci/badge.svg)](https://github.com/karafka/sidekiq-backend/actions?query=workflow%3Aci)
4
- [![Join the chat at https://gitter.im/karafka/karafka](https://badges.gitter.im/karafka/karafka.svg)](https://gitter.im/karafka/karafka?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
12
+ [![Gem Version](https://badge.fury.io/rb/karafka-sidekiq-backend.svg)](http://badge.fury.io/rb/karafka-sidekiq-backend)
13
+ [![Join the chat at https://slack.karafka.io](https://raw.githubusercontent.com/karafka/misc/master/slack.svg)](https://slack.karafka.io)
5
14
 
6
15
  [Karafka Sidekiq Backend](https://github.com/karafka/sidekiq-backend) provides support for consuming (processing) received Kafka messages inside of Sidekiq workers.
7
16
 
@@ -48,7 +57,7 @@ App.routes.draw do
48
57
  backend :sidekiq
49
58
  consumer Videos::DetailsConsumer
50
59
  worker Workers::DetailsWorker
51
- interchanger Interchangers::MyCustomInterchanger
60
+ interchanger Interchangers::MyCustomInterchanger.new
52
61
  end
53
62
  end
54
63
  end
@@ -63,7 +72,7 @@ There are two options you can set inside of the ```topic``` block:
63
72
  | Option | Value type | Description |
64
73
  |--------------|------------|-------------------------------------------------------------------------------------------------------------------|
65
74
  | worker | Class | Name of a worker class that we want to use to schedule perform code |
66
- | interchanger | Class | Name of an interchanger class that we want to use to pass the incoming data to Sidekiq |
75
+ | interchanger | Instance | Instance of an interchanger class that we want to use to pass the incoming data to Sidekiq |
67
76
 
68
77
 
69
78
  ### Workers
@@ -101,7 +110,7 @@ App.routes.draw do
101
110
  consumer_group :videos_consumer do
102
111
  topic :binary_video_details do
103
112
  consumer Videos::DetailsConsumer
104
- interchanger Interchangers::MyCustomInterchanger
113
+ interchanger Interchangers::MyCustomInterchanger.new
105
114
  end
106
115
  end
107
116
  end
@@ -131,12 +140,8 @@ end
131
140
 
132
141
  ## Note on contributions
133
142
 
134
- First, thank you for considering contributing to Karafka! It's people like you that make the open source community such a great community!
135
-
136
- Each pull request must pass all the RSpec specs and meet our quality requirements.
137
-
138
- To check if everything is as it should be, we use [Coditsu](https://coditsu.io) that combines multiple linters and code analyzers for both code and documentation. Once you're done with your changes, submit a pull request.
143
+ First, thank you for considering contributing to the Karafka ecosystem! It's people like you that make the open source community such a great community!
139
144
 
140
- Coditsu will automatically check your work against our quality standards. You can find your commit check results on the [builds page](https://app.coditsu.io/karafka/repositories/karafka-sidekiq-backend/builds/commit_builds) of Karafka Sidekiq Backend repository.
145
+ Each pull request must pass all the RSpec specs, integration tests and meet our quality requirements.
141
146
 
142
- [![coditsu](https://coditsu.io/assets/quality_bar.svg)](https://app.coditsu.io/karafka/repositories/karafka-sidekiq-backend/builds/commit_builds)
147
+ Fork it, update and wait for the Github Actions results.
data/certs/mensfeld.pem CHANGED
@@ -1,25 +1,25 @@
1
1
  -----BEGIN CERTIFICATE-----
2
2
  MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhtYWNp
3
- ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMjAwODExMDkxNTM3WhcNMjEwODExMDkx
4
- NTM3WjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
5
- CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDCpXsCgmINb6lHBXXBdyrgsBPSxC4/
6
- 2H+weJ6L9CruTiv2+2/ZkQGtnLcDgrD14rdLIHK7t0o3EKYlDT5GhD/XUVhI15JE
7
- N7IqnPUgexe1fbZArwQ51afxz2AmPQN2BkB2oeQHXxnSWUGMhvcEZpfbxCCJH26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sBpNegcG6w075YEwzX/38a
19
+ 8V9B/Yri2OGELBz8ykl7BsXUgNoUPA/4pHF6YRLz+VirOaUIQ4JfY7xGj6fSOWWz
20
+ /rQ/d77r6o1mfJYM/3BRVg73a3b7DmRnE5qjwmSaSQ7u802pJnLesmArch0xGCT/
21
+ fMmRli1Qb+6qOTl9mzD6UDMAyFR4t6MStLm0mIEqM0nBO5nUdUWbC7l9qXEf8XBE
22
+ 2DP28p3EqSuS+lKbAWKcqv7t0iRhhmaod+Yn9mcrLN1sa3q3KSQ9BCyxezCD4Mk2
23
+ R2P11bWoCtr70BsccVrN8jEhzwXngMyI2gVt750Y+dbTu1KgRqZKp/ECe7ZzPzXj
24
+ pIy9vHxTANKYVyI4qj8OrFdEM5BQNu8oQpL0iQ==
25
25
  -----END CERTIFICATE-----
@@ -10,14 +10,14 @@ Gem::Specification.new do |spec|
10
10
  spec.platform = Gem::Platform::RUBY
11
11
  spec.authors = ['Maciej Mensfeld']
12
12
  spec.email = %w[maciej@mensfeld.pl]
13
- spec.homepage = 'https://github.com/karafka/karafka-sidekiq-backend'
13
+ spec.homepage = 'https://karafka.io'
14
14
  spec.summary = 'Karafka Sidekiq backend for background messages processing'
15
15
  spec.description = 'Karafka Sidekiq backend for background messages processing'
16
- spec.license = 'LGPL-3.0'
16
+ spec.license = 'MIT'
17
17
 
18
18
  spec.add_dependency 'karafka', '~> 1.4.0'
19
19
  spec.add_dependency 'sidekiq', '>= 4.2'
20
- spec.required_ruby_version = '>= 2.5.0'
20
+ spec.required_ruby_version = '>= 2.7'
21
21
 
22
22
  if $PROGRAM_NAME.end_with?('gem')
23
23
  spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
@@ -27,4 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
28
28
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
29
29
  spec.require_paths = %w[lib]
30
+ spec.metadata = { 'source_code_uri' => 'https://github.com/karafka/sidekiq-backend' }
30
31
  end
@@ -6,7 +6,7 @@ module Karafka
6
6
  # Sidekiq backend that schedules stuff to Sidekiq worker for delayed execution
7
7
  module Sidekiq
8
8
  # Karafka Sidekiq backend version
9
- VERSION = '1.4.1'
9
+ VERSION = '1.4.4'
10
10
 
11
11
  # Enqueues the execution of perform method into a worker.
12
12
  # @note Each worker needs to have a class #perform_async method that will allow us to pass
@@ -15,10 +15,18 @@ module Karafka
15
15
  # in the worker)
16
16
  def process
17
17
  Karafka.monitor.instrument('backends.sidekiq.process', caller: self) do
18
+ # We add batch metadata only for batch worker
19
+ batch_metadata_hash = if respond_to?(:batch_metadata)
20
+ # We remove deserializer as it's not safe to convert it to json
21
+ # and we can rebuild it anyhow based on the routing data in the
22
+ # worker
23
+ batch_metadata.to_h.transform_keys(&:to_s).except('deserializer')
24
+ end
25
+
18
26
  topic.worker.perform_async(
19
27
  topic.id,
20
28
  topic.interchanger.encode(params_batch),
21
- respond_to?(:batch_metadata) ? batch_metadata.to_h : nil
29
+ batch_metadata_hash
22
30
  )
23
31
  end
24
32
  end
@@ -19,6 +19,7 @@ module Karafka
19
19
  # @param subclass [Class] subclass of the worker
20
20
  # @return [Class] subclass of the worker that was selected
21
21
  def inherited(subclass)
22
+ super
22
23
  @inherited ||= subclass
23
24
  end
24
25
  end
@@ -11,8 +11,8 @@ module Karafka
11
11
  @worker ||= backend == :sidekiq ? Karafka::Workers::Builder.new(consumer).build : nil
12
12
  end
13
13
 
14
- # @return [Class] Interchanger class (not an instance) that we want to use to interchange
15
- # params between Karafka server and Karafka background job
14
+ # @return [#encode, #decode] Interchanger instance (not a class) that we want to use to
15
+ # interchange params between Karafka server and Karafka background job
16
16
  def interchanger
17
17
  @interchanger ||= Karafka::Interchanger.new
18
18
  end
@@ -14,9 +14,19 @@ module Karafka
14
14
  # @return [Array<Hash>] Array with hash built out of params data
15
15
  def encode(params_batch)
16
16
  params_batch.map do |param|
17
+ metadata_hash = param.metadata.to_h
18
+ # All the metadata must have stringified keys in order to safe serialize
19
+ metadata_hash.transform_keys!(&:to_s)
20
+ # This will be taken back from the routing and is not safe for serialization
21
+ metadata_hash.delete('deserializer')
22
+
23
+ # Cast times to strings, we will de-serialize it back in Sidekiq
24
+ metadata_hash['receive_time'] = metadata_hash['receive_time'].to_f
25
+ metadata_hash['create_time'] = metadata_hash['create_time'].to_f
26
+
17
27
  {
18
28
  'raw_payload' => param.raw_payload,
19
- 'metadata' => param.metadata.to_h
29
+ 'metadata' => metadata_hash
20
30
  }
21
31
  end
22
32
  end
@@ -24,7 +34,16 @@ module Karafka
24
34
  # @param params_batch [Array<Hash>] Sidekiq params that are now an array
25
35
  # @return [Array<Hash>] exactly what we've fetched from Sidekiq
26
36
  def decode(params_batch)
27
- params_batch
37
+ params_batch.map do |param|
38
+ metadata = param['metadata']
39
+ # Covert serialized dates back to what they were
40
+ metadata['receive_time'] = Time.at(metadata['receive_time']).to_time
41
+ metadata['create_time'] = Time.at(metadata['create_time']).to_time
42
+
43
+ param['metadata'] = metadata
44
+
45
+ param
46
+ end
28
47
  end
29
48
  end
30
49
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-sidekiq-backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -11,30 +11,30 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhtYWNp
14
- ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMjAwODExMDkxNTM3WhcNMjEwODExMDkx
15
- NTM3WjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
16
- CSqGSIb3DQEBAQUAA4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27
+ c2ZlbGQucGwwDQYJKoZIhvcNAQELBQADggGBADD0/UuTTFgW+CGk2U0RDw2RBOca
28
+ W2LTF/G7AOzuzD0Tc4voc7WXyrgKwJREv8rgBimLnNlgmFJLmtUCh2U/MgxvcilH
29
+ yshYcbseNvjkrtYnLRlWZR4SSB6Zei5AlyGVQLPkvdsBpNegcG6w075YEwzX/38a
30
+ 8V9B/Yri2OGELBz8ykl7BsXUgNoUPA/4pHF6YRLz+VirOaUIQ4JfY7xGj6fSOWWz
31
+ /rQ/d77r6o1mfJYM/3BRVg73a3b7DmRnE5qjwmSaSQ7u802pJnLesmArch0xGCT/
32
+ fMmRli1Qb+6qOTl9mzD6UDMAyFR4t6MStLm0mIEqM0nBO5nUdUWbC7l9qXEf8XBE
33
+ 2DP28p3EqSuS+lKbAWKcqv7t0iRhhmaod+Yn9mcrLN1sa3q3KSQ9BCyxezCD4Mk2
34
+ R2P11bWoCtr70BsccVrN8jEhzwXngMyI2gVt750Y+dbTu1KgRqZKp/ECe7ZzPzXj
35
+ pIy9vHxTANKYVyI4qj8OrFdEM5BQNu8oQpL0iQ==
36
36
  -----END CERTIFICATE-----
37
- date: 2020-10-27 00:00:00.000000000 Z
37
+ date: 2022-03-06 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: karafka
@@ -73,7 +73,6 @@ extra_rdoc_files: []
73
73
  files:
74
74
  - ".coditsu/ci.yml"
75
75
  - ".diffend.yml"
76
- - ".github/FUNDING.yml"
77
76
  - ".github/workflows/ci.yml"
78
77
  - ".gitignore"
79
78
  - ".rspec"
@@ -82,7 +81,7 @@ files:
82
81
  - CHANGELOG.md
83
82
  - Gemfile
84
83
  - Gemfile.lock
85
- - LICENSE
84
+ - MIT-LICENSE
86
85
  - README.md
87
86
  - Rakefile
88
87
  - certs/mensfeld.pem
@@ -101,10 +100,11 @@ files:
101
100
  - lib/karafka/interchanger.rb
102
101
  - lib/karafka/workers/builder.rb
103
102
  - lib/karafka_sidekiq_backend.rb
104
- homepage: https://github.com/karafka/karafka-sidekiq-backend
103
+ homepage: https://karafka.io
105
104
  licenses:
106
- - LGPL-3.0
107
- metadata: {}
105
+ - MIT
106
+ metadata:
107
+ source_code_uri: https://github.com/karafka/sidekiq-backend
108
108
  post_install_message:
109
109
  rdoc_options: []
110
110
  require_paths:
@@ -113,14 +113,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: 2.5.0
116
+ version: '2.7'
117
117
  required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - ">="
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.1.4
123
+ rubygems_version: 3.3.3
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Karafka Sidekiq backend for background messages processing
metadata.gz.sig CHANGED
Binary file
data/.github/FUNDING.yml DELETED
@@ -1 +0,0 @@
1
- open_collective: karafka
data/LICENSE DELETED
@@ -1,165 +0,0 @@
1
- GNU LESSER GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
-
9
- This version of the GNU Lesser General Public License incorporates
10
- the terms and conditions of version 3 of the GNU General Public
11
- License, supplemented by the additional permissions listed below.
12
-
13
- 0. Additional Definitions.
14
-
15
- As used herein, "this License" refers to version 3 of the GNU Lesser
16
- General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
- General Public License.
18
-
19
- "The Library" refers to a covered work governed by this License,
20
- other than an Application or a Combined Work as defined below.
21
-
22
- An "Application" is any work that makes use of an interface provided
23
- by the Library, but which is not otherwise based on the Library.
24
- Defining a subclass of a class defined by the Library is deemed a mode
25
- of using an interface provided by the Library.
26
-
27
- A "Combined Work" is a work produced by combining or linking an
28
- Application with the Library. The particular version of the Library
29
- with which the Combined Work was made is also called the "Linked
30
- Version".
31
-
32
- The "Minimal Corresponding Source" for a Combined Work means the
33
- Corresponding Source for the Combined Work, excluding any source code
34
- for portions of the Combined Work that, considered in isolation, are
35
- based on the Application, and not on the Linked Version.
36
-
37
- The "Corresponding Application Code" for a Combined Work means the
38
- object code and/or source code for the Application, including any data
39
- and utility programs needed for reproducing the Combined Work from the
40
- Application, but excluding the System Libraries of the Combined Work.
41
-
42
- 1. Exception to Section 3 of the GNU GPL.
43
-
44
- You may convey a covered work under sections 3 and 4 of this License
45
- without being bound by section 3 of the GNU GPL.
46
-
47
- 2. Conveying Modified Versions.
48
-
49
- If you modify a copy of the Library, and, in your modifications, a
50
- facility refers to a function or data to be supplied by an Application
51
- that uses the facility (other than as an argument passed when the
52
- facility is invoked), then you may convey a copy of the modified
53
- version:
54
-
55
- a) under this License, provided that you make a good faith effort to
56
- ensure that, in the event an Application does not supply the
57
- function or data, the facility still operates, and performs
58
- whatever part of its purpose remains meaningful, or
59
-
60
- b) under the GNU GPL, with none of the additional permissions of
61
- this License applicable to that copy.
62
-
63
- 3. Object Code Incorporating Material from Library Header Files.
64
-
65
- The object code form of an Application may incorporate material from
66
- a header file that is part of the Library. You may convey such object
67
- code under terms of your choice, provided that, if the incorporated
68
- material is not limited to numerical parameters, data structure
69
- layouts and accessors, or small macros, inline functions and templates
70
- (ten or fewer lines in length), you do both of the following:
71
-
72
- a) Give prominent notice with each copy of the object code that the
73
- Library is used in it and that the Library and its use are
74
- covered by this License.
75
-
76
- b) Accompany the object code with a copy of the GNU GPL and this license
77
- document.
78
-
79
- 4. Combined Works.
80
-
81
- You may convey a Combined Work under terms of your choice that,
82
- taken together, effectively do not restrict modification of the
83
- portions of the Library contained in the Combined Work and reverse
84
- engineering for debugging such modifications, if you also do each of
85
- the following:
86
-
87
- a) Give prominent notice with each copy of the Combined Work that
88
- the Library is used in it and that the Library and its use are
89
- covered by this License.
90
-
91
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
- document.
93
-
94
- c) For a Combined Work that displays copyright notices during
95
- execution, include the copyright notice for the Library among
96
- these notices, as well as a reference directing the user to the
97
- copies of the GNU GPL and this license document.
98
-
99
- d) Do one of the following:
100
-
101
- 0) Convey the Minimal Corresponding Source under the terms of this
102
- License, and the Corresponding Application Code in a form
103
- suitable for, and under terms that permit, the user to
104
- recombine or relink the Application with a modified version of
105
- the Linked Version to produce a modified Combined Work, in the
106
- manner specified by section 6 of the GNU GPL for conveying
107
- Corresponding Source.
108
-
109
- 1) Use a suitable shared library mechanism for linking with the
110
- Library. A suitable mechanism is one that (a) uses at run time
111
- a copy of the Library already present on the user's computer
112
- system, and (b) will operate properly with a modified version
113
- of the Library that is interface-compatible with the Linked
114
- Version.
115
-
116
- e) Provide Installation Information, but only if you would otherwise
117
- be required to provide such information under section 6 of the
118
- GNU GPL, and only to the extent that such information is
119
- necessary to install and execute a modified version of the
120
- Combined Work produced by recombining or relinking the
121
- Application with a modified version of the Linked Version. (If
122
- you use option 4d0, the Installation Information must accompany
123
- the Minimal Corresponding Source and Corresponding Application
124
- Code. If you use option 4d1, you must provide the Installation
125
- Information in the manner specified by section 6 of the GNU GPL
126
- for conveying Corresponding Source.)
127
-
128
- 5. Combined Libraries.
129
-
130
- You may place library facilities that are a work based on the
131
- Library side by side in a single library together with other library
132
- facilities that are not Applications and are not covered by this
133
- License, and convey such a combined library under terms of your
134
- choice, if you do both of the following:
135
-
136
- a) Accompany the combined library with a copy of the same work based
137
- on the Library, uncombined with any other library facilities,
138
- conveyed under the terms of this License.
139
-
140
- b) Give prominent notice with the combined library that part of it
141
- is a work based on the Library, and explaining where to find the
142
- accompanying uncombined form of the same work.
143
-
144
- 6. Revised Versions of the GNU Lesser General Public License.
145
-
146
- The Free Software Foundation may publish revised and/or new versions
147
- of the GNU Lesser General Public License from time to time. Such new
148
- versions will be similar in spirit to the present version, but may
149
- differ in detail to address new problems or concerns.
150
-
151
- Each version is given a distinguishing version number. If the
152
- Library as you received it specifies that a certain numbered version
153
- of the GNU Lesser General Public License "or any later version"
154
- applies to it, you have the option of following the terms and
155
- conditions either of that published version or of any later version
156
- published by the Free Software Foundation. If the Library as you
157
- received it does not specify a version number of the GNU Lesser
158
- General Public License, you may choose any version of the GNU Lesser
159
- General Public License ever published by the Free Software Foundation.
160
-
161
- If the Library as you received it specifies that a proxy can decide
162
- whether future versions of the GNU Lesser General Public License shall
163
- apply, that proxy's public statement of acceptance of any version is
164
- permanent authorization for you to choose that version for the
165
- Library.