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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +27 -3
- data/.ruby-version +1 -1
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +71 -84
- data/MIT-LICENSE +18 -0
- data/README.md +16 -11
- data/certs/mensfeld.pem +21 -21
- data/karafka-sidekiq-backend.gemspec +4 -3
- data/lib/karafka/backends/sidekiq.rb +10 -2
- data/lib/karafka/base_worker.rb +1 -0
- data/lib/karafka/extensions/sidekiq_topic_attributes.rb +2 -2
- data/lib/karafka/interchanger.rb +21 -2
- data.tar.gz.sig +0 -0
- metadata +30 -30
- metadata.gz.sig +0 -0
- data/.github/FUNDING.yml +0 -1
- data/LICENSE +0 -165
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c4560c74ccb09e782379a950507c3989adef5c3be5415beeeb2003b9d641768
|
4
|
+
data.tar.gz: 22422624c731faa13641adf08a36cd067913826358a57a38e45f8a5a5be553af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ec03fbc6ece2e0664e61d44de00b30f3e0690cb0d3bc8e15eceb9af73b33272264927b8fccb025c742911fa4b506360a5bb7d1536e85f9ed2421a9ba78405ce
|
7
|
+
data.tar.gz: 5222810dc912bde65da7db269e07d3556a850e471b3b02217fba07764590e6673e3f975bbe7e697f2204668d24cc518ff97eae20b7d684803208b35a4017a8bb
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.github/workflows/ci.yml
CHANGED
@@ -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: '
|
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
|
-
|
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.
|
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.
|
12
|
-
connection_pool (2.2.
|
13
|
-
delivery_boy (1.0
|
14
|
-
king_konf (~> 0
|
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.
|
17
|
-
digest-crc (0.6.
|
18
|
-
rake (
|
19
|
-
docile (1.
|
20
|
-
dry-configurable (0.
|
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.
|
23
|
-
|
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.
|
27
|
-
dry-core (0.
|
25
|
+
dry-configurable (~> 0.13, >= 0.13.0)
|
26
|
+
dry-core (0.7.1)
|
28
27
|
concurrent-ruby (~> 1.0)
|
29
|
-
dry-
|
30
|
-
dry-events (0.2.0)
|
28
|
+
dry-events (0.3.0)
|
31
29
|
concurrent-ruby (~> 1.0)
|
32
|
-
dry-core (~> 0.
|
33
|
-
|
34
|
-
dry-
|
35
|
-
dry-
|
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.
|
39
|
-
|
40
|
-
|
41
|
-
dry-
|
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.
|
40
|
+
dry-schema (1.9.1)
|
46
41
|
concurrent-ruby (~> 1.0)
|
47
|
-
dry-configurable (~> 0.
|
48
|
-
dry-core (~> 0.
|
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.
|
53
|
-
dry-types (1.
|
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.
|
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.
|
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.
|
64
|
-
dry-equalizer (~> 0.2)
|
56
|
+
dry-core (~> 0.5, >= 0.5)
|
65
57
|
dry-initializer (~> 3.0)
|
66
|
-
dry-schema (~> 1.
|
67
|
-
envlogic (1.1.
|
58
|
+
dry-schema (~> 1.9, >= 1.9.1)
|
59
|
+
envlogic (1.1.4)
|
68
60
|
dry-inflector (~> 0.1)
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
dry-
|
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
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
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.
|
87
|
-
redis (4.
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
rspec-
|
92
|
-
|
93
|
-
rspec-
|
94
|
-
rspec-
|
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.
|
99
|
-
rspec-mocks (3.
|
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.
|
102
|
-
rspec-support (3.
|
103
|
-
ruby-kafka (1.
|
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
|
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.
|
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
|
-
|
114
|
-
|
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.
|
117
|
-
dry-monitor (~> 0.
|
118
|
-
dry-validation (~> 1.
|
119
|
-
ruby-kafka (>=
|
120
|
-
zeitwerk (~> 2.
|
121
|
-
zeitwerk (2.4
|
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
|
-
|
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.
|
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
|
-
[![
|
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 |
|
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
|
-
|
145
|
+
Each pull request must pass all the RSpec specs, integration tests and meet our quality requirements.
|
141
146
|
|
142
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMjEwODExMTQxNTEzWhcNMjIwODExMTQx
|
4
|
+
NTEzWjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
|
5
|
+
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDV2jKH4Ti87GM6nyT6D+ESzTI0MZDj
|
6
|
+
ak2/TEwnxvijMJyCCPKT/qIkbW4/f0VHM4rhPr1nW73sb5SZBVFCLlJcOSKOBdUY
|
7
|
+
TMY+SIXN2EtUaZuhAOe8LxtxjHTgRHvHcqUQMBENXTISNzCo32LnUxweu66ia4Pd
|
8
|
+
1mNRhzOqNv9YiBZvtBf7IMQ+sYdOCjboq2dlsWmJiwiDpY9lQBTnWORnT3mQxU5x
|
9
|
+
vPSwnLB854cHdCS8fQo4Dje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|
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://
|
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 = '
|
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.
|
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.
|
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
|
-
|
29
|
+
batch_metadata_hash
|
22
30
|
)
|
23
31
|
end
|
24
32
|
end
|
data/lib/karafka/base_worker.rb
CHANGED
@@ -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 [
|
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
|
data/lib/karafka/interchanger.rb
CHANGED
@@ -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' =>
|
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.
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
14
|
+
ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMjEwODExMTQxNTEzWhcNMjIwODExMTQx
|
15
|
+
NTEzWjAjMSEwHwYDV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xvcilH
|
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:
|
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://
|
103
|
+
homepage: https://karafka.io
|
105
104
|
licenses:
|
106
|
-
-
|
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.
|
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.
|
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.
|