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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45788f5dd509d8a61a1480ff5c1b41f89b683d2100e0dcedaf6e35e6ce3af447
|
4
|
+
data.tar.gz: d5e5638fd2a83b91f78cf1f38d03bd2594fb562a0cc8ad6cf2e45f60e72cc692
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b2863022df6dc78f23ca557450a9757e137d110f9a6c49a29f572cd701863143e638394c341e8f982bdce4255df923879c8410ce081503c43e3f9a0ce2e777
|
7
|
+
data.tar.gz: ec0eee525c34634d15b04c85a492e329d4749f179ff2c21d3ce2e50cccb4b6d061465c13df322a026b8924974f743277448464db818e13d73ef90f5ce930f796
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.diffend.yml
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
name: ci
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
schedule:
|
6
|
+
- cron: '0 1 * * *'
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
specs:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
strategy:
|
12
|
+
fail-fast: false
|
13
|
+
matrix:
|
14
|
+
ruby:
|
15
|
+
- '2.7'
|
16
|
+
- '2.6'
|
17
|
+
- '2.5'
|
18
|
+
include:
|
19
|
+
- ruby: '2.7'
|
20
|
+
coverage: 'true'
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Install package dependencies
|
24
|
+
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
|
25
|
+
- name: Set up Ruby
|
26
|
+
uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{matrix.ruby}}
|
29
|
+
- name: Install latest bundler
|
30
|
+
run: |
|
31
|
+
gem install bundler --no-document
|
32
|
+
bundle config set without 'tools benchmarks docs'
|
33
|
+
- name: Bundle install
|
34
|
+
run: |
|
35
|
+
bundle config set without development
|
36
|
+
bundle install --jobs 4 --retry 3
|
37
|
+
- name: Run Kafka with docker-compose
|
38
|
+
run: docker-compose up -d
|
39
|
+
- name: Run all tests
|
40
|
+
env:
|
41
|
+
GITHUB_COVERAGE: ${{matrix.coverage}}
|
42
|
+
run: bundle exec rspec
|
43
|
+
coditsu:
|
44
|
+
runs-on: ubuntu-latest
|
45
|
+
strategy:
|
46
|
+
fail-fast: false
|
47
|
+
steps:
|
48
|
+
- uses: actions/checkout@v2
|
49
|
+
with:
|
50
|
+
fetch-depth: 0
|
51
|
+
- name: Run Coditsu
|
52
|
+
run: \curl -sSL https://api.coditsu.io/run/ci | bash
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
# Karafka framework changelog
|
2
2
|
|
3
|
+
## 1.4.0 (2020-09-05)
|
4
|
+
- Rename `Karafka::Params::Metadata` to `Karafka::Params::BatchMetadata`
|
5
|
+
` Rename consumer `#metadata` to `#batch_metadata`
|
6
|
+
- Separate metadata (including Karafka native metadata) from the root of params (backwards compatibility preserved thanks to rabotyaga)
|
7
|
+
- Remove metadata hash dependency
|
8
|
+
- Remove params dependency on a hash in favour of PORO
|
9
|
+
- Remove batch metadata dependency on a hash
|
10
|
+
- Remove MultiJson in favour of JSON in the default deserializer
|
11
|
+
- allow accessing all the metadata without accessing the payload
|
12
|
+
- freeze params and underlying elements except for the mutable payload
|
13
|
+
- provide access to raw payload after serialization
|
14
|
+
- fixes a bug where a non-deserializable (error) params would be marked as deserialized after first unsuccessful deserialization attempt
|
15
|
+
- fixes bug where karafka would mutate internal ruby-kafka state
|
16
|
+
- fixes bug where topic name in metadata would not be mapped using topic mappers
|
17
|
+
- simplifies the params and params batch API, before `#payload` usage, it won't be deserialized
|
18
|
+
- removes the `#[]` API from params to prevent from accessing raw data in a different way than #raw_payload
|
19
|
+
- makes the params batch operations consistent as params payload is deserialized only when accessed explicitly
|
20
|
+
|
21
|
+
## 1.3.7 (2020-08-11)
|
22
|
+
- #599 - Allow metadata access without deserialization attempt (rabotyaga)
|
23
|
+
- Sync with ruby-kafka `1.2.0` api
|
24
|
+
|
25
|
+
## 1.3.6 (2020-04-24)
|
26
|
+
- #583 - Use Karafka.logger for CLI messages (prikha)
|
27
|
+
- #582 - Cannot only define seed brokers in consumer groups
|
28
|
+
|
3
29
|
## 1.3.5 (2020-04-02)
|
4
30
|
- #578 - ThreadError: can't be called from trap context patch
|
5
31
|
|
@@ -78,6 +104,7 @@
|
|
78
104
|
- #508 - Reset the consumers instances upon reconnecting to a cluster
|
79
105
|
- [#530](https://github.com/karafka/karafka/pull/530) - expose ruby and ruby-kafka version
|
80
106
|
- [534](https://github.com/karafka/karafka/pull/534) - Allow to use headers in the deserializer object
|
107
|
+
- [#319](https://github.com/karafka/karafka/pull/328) - Support for exponential backoff in pause
|
81
108
|
|
82
109
|
## 1.2.11
|
83
110
|
- [#470](https://github.com/karafka/karafka/issues/470) Karafka not working with dry-configurable 0.8
|
@@ -116,7 +143,6 @@
|
|
116
143
|
- #318 - Partition pausing doesn't work with custom topic mappers
|
117
144
|
- Rename ConfigAdapter to ApiAdapter to better reflect what it does
|
118
145
|
- #317 - Manual offset committing doesn't work with custom topic mappers
|
119
|
-
- #319 - Support for exponential backoff in pause
|
120
146
|
|
121
147
|
## 1.2.2
|
122
148
|
- #312 - Broken for ActiveSupport 5.2.0
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
|
|
34
34
|
|
35
35
|
## Enforcement
|
36
36
|
|
37
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at maciej@
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at maciej@mensfeld.pl. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
38
38
|
|
39
39
|
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
40
40
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,38 +1,38 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
karafka (1.
|
4
|
+
karafka (1.4.0)
|
5
5
|
dry-configurable (~> 0.8)
|
6
6
|
dry-inflector (~> 0.1)
|
7
7
|
dry-monitor (~> 0.3)
|
8
8
|
dry-validation (~> 1.2)
|
9
9
|
envlogic (~> 1.1)
|
10
10
|
irb (~> 1.0)
|
11
|
-
multi_json (>= 1.12)
|
12
11
|
rake (>= 11.3)
|
13
|
-
ruby-kafka (>= 0.
|
12
|
+
ruby-kafka (>= 1.0.0)
|
14
13
|
thor (>= 0.20)
|
15
|
-
waterdrop (~> 1.
|
14
|
+
waterdrop (~> 1.4.0)
|
16
15
|
zeitwerk (~> 2.1)
|
17
16
|
|
18
17
|
GEM
|
19
18
|
remote: https://rubygems.org/
|
20
19
|
specs:
|
21
|
-
activesupport (6.0.
|
20
|
+
activesupport (6.0.3.2)
|
22
21
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
23
22
|
i18n (>= 0.7, < 2)
|
24
23
|
minitest (~> 5.1)
|
25
24
|
tzinfo (~> 1.1)
|
26
|
-
zeitwerk (~> 2.2)
|
27
|
-
byebug (11.1.
|
28
|
-
concurrent-ruby (1.1.
|
25
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
26
|
+
byebug (11.1.3)
|
27
|
+
concurrent-ruby (1.1.7)
|
29
28
|
delivery_boy (1.0.1)
|
30
29
|
king_konf (~> 0.3)
|
31
30
|
ruby-kafka (~> 1.0)
|
32
|
-
diff-lcs (1.
|
33
|
-
digest-crc (0.
|
31
|
+
diff-lcs (1.4.4)
|
32
|
+
digest-crc (0.6.1)
|
33
|
+
rake (~> 13.0)
|
34
34
|
docile (1.3.2)
|
35
|
-
dry-configurable (0.11.
|
35
|
+
dry-configurable (0.11.6)
|
36
36
|
concurrent-ruby (~> 1.0)
|
37
37
|
dry-core (~> 0.4, >= 0.4.7)
|
38
38
|
dry-equalizer (~> 0.2)
|
@@ -48,16 +48,16 @@ GEM
|
|
48
48
|
dry-equalizer (~> 0.2)
|
49
49
|
dry-inflector (0.2.0)
|
50
50
|
dry-initializer (3.0.3)
|
51
|
-
dry-logic (1.0.
|
51
|
+
dry-logic (1.0.7)
|
52
52
|
concurrent-ruby (~> 1.0)
|
53
53
|
dry-core (~> 0.2)
|
54
54
|
dry-equalizer (~> 0.2)
|
55
|
-
dry-monitor (0.3.
|
55
|
+
dry-monitor (0.3.2)
|
56
56
|
dry-configurable (~> 0.5)
|
57
57
|
dry-core (~> 0.4)
|
58
58
|
dry-equalizer (~> 0.2)
|
59
|
-
dry-events (~> 0.
|
60
|
-
dry-schema (1.5.
|
59
|
+
dry-events (~> 0.2)
|
60
|
+
dry-schema (1.5.4)
|
61
61
|
concurrent-ruby (~> 1.0)
|
62
62
|
dry-configurable (~> 0.8, >= 0.8.3)
|
63
63
|
dry-core (~> 0.4)
|
@@ -72,44 +72,43 @@ GEM
|
|
72
72
|
dry-equalizer (~> 0.3)
|
73
73
|
dry-inflector (~> 0.1, >= 0.1.2)
|
74
74
|
dry-logic (~> 1.0, >= 1.0.2)
|
75
|
-
dry-validation (1.5.
|
75
|
+
dry-validation (1.5.6)
|
76
76
|
concurrent-ruby (~> 1.0)
|
77
77
|
dry-container (~> 0.7, >= 0.7.1)
|
78
78
|
dry-core (~> 0.4)
|
79
79
|
dry-equalizer (~> 0.2)
|
80
80
|
dry-initializer (~> 3.0)
|
81
|
-
dry-schema (~> 1.5)
|
82
|
-
envlogic (1.1.
|
81
|
+
dry-schema (~> 1.5, >= 1.5.2)
|
82
|
+
envlogic (1.1.2)
|
83
83
|
dry-inflector (~> 0.1)
|
84
|
-
factory_bot (
|
85
|
-
activesupport (>=
|
86
|
-
i18n (1.8.
|
84
|
+
factory_bot (6.1.0)
|
85
|
+
activesupport (>= 5.0.0)
|
86
|
+
i18n (1.8.5)
|
87
87
|
concurrent-ruby (~> 1.0)
|
88
88
|
io-console (0.5.6)
|
89
|
-
irb (1.2.
|
89
|
+
irb (1.2.4)
|
90
90
|
reline (>= 0.0.1)
|
91
91
|
king_konf (0.3.7)
|
92
|
-
minitest (5.14.
|
93
|
-
multi_json (1.14.1)
|
92
|
+
minitest (5.14.2)
|
94
93
|
rake (13.0.1)
|
95
|
-
reline (0.1.
|
94
|
+
reline (0.1.4)
|
96
95
|
io-console (~> 0.5)
|
97
96
|
rspec (3.9.0)
|
98
97
|
rspec-core (~> 3.9.0)
|
99
98
|
rspec-expectations (~> 3.9.0)
|
100
99
|
rspec-mocks (~> 3.9.0)
|
101
|
-
rspec-core (3.9.
|
102
|
-
rspec-support (~> 3.9.
|
103
|
-
rspec-expectations (3.9.
|
100
|
+
rspec-core (3.9.2)
|
101
|
+
rspec-support (~> 3.9.3)
|
102
|
+
rspec-expectations (3.9.2)
|
104
103
|
diff-lcs (>= 1.2.0, < 2.0)
|
105
104
|
rspec-support (~> 3.9.0)
|
106
105
|
rspec-mocks (3.9.1)
|
107
106
|
diff-lcs (>= 1.2.0, < 2.0)
|
108
107
|
rspec-support (~> 3.9.0)
|
109
|
-
rspec-support (3.9.
|
110
|
-
ruby-kafka (1.
|
108
|
+
rspec-support (3.9.3)
|
109
|
+
ruby-kafka (1.2.0)
|
111
110
|
digest-crc
|
112
|
-
simplecov (0.
|
111
|
+
simplecov (0.19.0)
|
113
112
|
docile (~> 1.1)
|
114
113
|
simplecov-html (~> 0.11)
|
115
114
|
simplecov-html (0.12.2)
|
@@ -117,14 +116,14 @@ GEM
|
|
117
116
|
thread_safe (0.3.6)
|
118
117
|
tzinfo (1.2.7)
|
119
118
|
thread_safe (~> 0.1)
|
120
|
-
waterdrop (1.
|
119
|
+
waterdrop (1.4.0)
|
121
120
|
delivery_boy (>= 0.2, < 2.x)
|
122
121
|
dry-configurable (~> 0.8)
|
123
122
|
dry-monitor (~> 0.3)
|
124
123
|
dry-validation (~> 1.2)
|
125
124
|
ruby-kafka (>= 0.7.8)
|
126
125
|
zeitwerk (~> 2.1)
|
127
|
-
zeitwerk (2.
|
126
|
+
zeitwerk (2.4.0)
|
128
127
|
|
129
128
|
PLATFORMS
|
130
129
|
ruby
|
data/README.md
CHANGED
@@ -2,11 +2,9 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/karafka/karafka.svg?branch=master)](https://travis-ci.org/karafka/karafka)
|
4
4
|
|
5
|
-
**Note**: Documentation presented here refers to Karafka `1.
|
5
|
+
**Note**: Documentation presented here refers to Karafka `1.4`.
|
6
6
|
|
7
|
-
If you
|
8
|
-
|
9
|
-
If you are looking for the documentation for Karafka `1.2.*`, it can be found [here](https://github.com/karafka/wiki/tree/1.2).
|
7
|
+
If you are looking for the documentation for Karafka `1.3.x`, it can be found [here](https://github.com/karafka/wiki/tree/1.3).
|
10
8
|
|
11
9
|
## About Karafka
|
12
10
|
|
@@ -98,4 +96,4 @@ This project exists thanks to all the people who contribute.
|
|
98
96
|
|
99
97
|
We are looking for sustainable sponsorship. If your company is relying on Karafka framework or simply want to see Karafka evolve faster to meet your requirements, please consider backing the project.
|
100
98
|
|
101
|
-
Please contact [Maciej Mensfeld](mailto:maciej@
|
99
|
+
Please contact [Maciej Mensfeld](mailto:maciej@mensfeld.pl) directly for more details.
|
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
|
+
ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMjAwODExMDkxNTM3WhcNMjEwODExMDkx
|
4
|
+
NTM3WjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
|
5
|
+
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDCpXsCgmINb6lHBXXBdyrgsBPSxC4/
|
6
|
+
2H+weJ6L9CruTiv2+2/ZkQGtnLcDgrD14rdLIHK7t0o3EKYlDT5GhD/XUVhI15JE
|
7
|
+
N7IqnPUgexe1fbZArwQ51afxz2AmPQN2BkB2oeQHXxnSWUGMhvcEZpfbxCCJH26w
|
8
|
+
hS0Ccsma8yxA6hSlGVhFVDuCr7c2L1di6cK2CtIDpfDaWqnVNJEwBYHIxrCoWK5g
|
9
|
+
sIGekVt/admS9gRhIMaIBg+Mshth5/DEyWO2QjteTodItlxfTctrfmiAl8X8T5JP
|
10
|
+
VXeLp5SSOJ5JXE80nShMJp3RFnGw5fqjX/ffjtISYh78/By4xF3a25HdWH9+qO2Z
|
11
|
+
tx0wSGc9/4gqNM0APQnjN/4YXrGZ4IeSjtE+OrrX07l0TiyikzSLFOkZCAp8oBJi
|
12
|
+
Fhlosz8xQDJf7mhNxOaZziqASzp/hJTU/tuDKl5+ql2icnMv5iV/i6SlmvU29QNg
|
13
|
+
LCV71pUv0pWzN+OZbHZKWepGhEQ3cG9MwvkCAwEAAaN3MHUwCQYDVR0TBAIwADAL
|
14
|
+
BgNVHQ8EBAMCBLAwHQYDVR0OBBYEFImGed2AXS070ohfRidiCEhXEUN+MB0GA1Ud
|
15
15
|
EQQWMBSBEm1hY2llakBtZW5zZmVsZC5wbDAdBgNVHRIEFjAUgRJtYWNpZWpAbWVu
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
c2ZlbGQucGwwDQYJKoZIhvcNAQELBQADggGBAKiHpwoENVrMi94V1zD4o8/6G3AU
|
17
|
+
gWz4udkPYHTZLUy3dLznc/sNjdkJFWT3E6NKYq7c60EpJ0m0vAEg5+F5pmNOsvD3
|
18
|
+
2pXLj9kisEeYhR516HwXAvtngboUcb75skqvBCU++4Pu7BRAPjO1/ihLSBexbwSS
|
19
|
+
fF+J5OWNuyHHCQp+kGPLtXJe2yUYyvSWDj3I2//Vk0VhNOIlaCS1+5/P3ZJThOtm
|
20
|
+
zJUBI7h3HgovwRpcnmk2mXTmU4Zx/bCzX8EA6VY0khEvnmiq7S6eBF0H9qH8KyQ6
|
21
|
+
EkVLpvmUDFcf/uNaBQdazEMB5jYtwoA8gQlANETNGPi51KlkukhKgaIEDMkBDJOx
|
22
|
+
65N7DzmkcyY0/GwjIVIxmRhcrCt1YeCUElmfFx0iida1/YRm6sB2AXqScc1+ECRi
|
23
|
+
2DND//YJUikn1zwbz1kT70XmHd97B4Eytpln7K+M1u2g1pHVEPW4owD/ammXNpUy
|
24
|
+
nt70FcDD4yxJQ+0YNiHd0N8IcVBM1TMIVctMNQ==
|
25
25
|
-----END CERTIFICATE-----
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
version: '2'
|
2
|
+
services:
|
3
|
+
zookeeper:
|
4
|
+
image: wurstmeister/zookeeper
|
5
|
+
ports:
|
6
|
+
- "2181:2181"
|
7
|
+
kafka:
|
8
|
+
image: wurstmeister/kafka:1.0.1
|
9
|
+
ports:
|
10
|
+
- "9092:9092"
|
11
|
+
environment:
|
12
|
+
KAFKA_ADVERTISED_HOST_NAME: localhost
|
13
|
+
KAFKA_ADVERTISED_PORT: 9092
|
14
|
+
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
15
|
+
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
|
16
|
+
volumes:
|
17
|
+
- /var/run/docker.sock:/var/run/docker.sock
|
data/karafka.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.version = ::Karafka::VERSION
|
12
12
|
spec.platform = Gem::Platform::RUBY
|
13
13
|
spec.authors = ['Maciej Mensfeld', 'Pavlo Vavruk', 'Adam Gwozdowski']
|
14
|
-
spec.email = %w[maciej@
|
14
|
+
spec.email = %w[maciej@mensfeld.pl pavlo.vavruk@gmail.com adam99g@gmail.com]
|
15
15
|
spec.homepage = 'https://github.com/karafka/karafka'
|
16
16
|
spec.summary = 'Ruby based framework for working with Apache Kafka'
|
17
17
|
spec.description = 'Framework used to simplify Apache Kafka based Ruby applications development'
|
@@ -23,11 +23,10 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency 'dry-validation', '~> 1.2'
|
24
24
|
spec.add_dependency 'envlogic', '~> 1.1'
|
25
25
|
spec.add_dependency 'irb', '~> 1.0'
|
26
|
-
spec.add_dependency 'multi_json', '>= 1.12'
|
27
26
|
spec.add_dependency 'rake', '>= 11.3'
|
28
|
-
spec.add_dependency 'ruby-kafka', '>= 0.
|
27
|
+
spec.add_dependency 'ruby-kafka', '>= 1.0.0'
|
29
28
|
spec.add_dependency 'thor', '>= 0.20'
|
30
|
-
spec.add_dependency 'waterdrop', '~> 1.
|
29
|
+
spec.add_dependency 'waterdrop', '~> 1.4.0'
|
31
30
|
spec.add_dependency 'zeitwerk', '~> 2.1'
|
32
31
|
|
33
32
|
spec.required_ruby_version = '>= 2.5.0'
|
data/lib/karafka.rb
CHANGED
data/lib/karafka/cli.rb
CHANGED
data/lib/karafka/cli/flow.rb
CHANGED
@@ -11,19 +11,22 @@ module Karafka
|
|
11
11
|
def call
|
12
12
|
topics.each do |topic|
|
13
13
|
any_topics = !topic.responder&.topics.nil?
|
14
|
+
log_messages = []
|
14
15
|
|
15
16
|
if any_topics
|
16
|
-
|
17
|
+
log_messages << "#{topic.name} =>"
|
17
18
|
|
18
19
|
topic.responder.topics.each_value do |responder_topic|
|
19
20
|
features = []
|
20
21
|
features << (responder_topic.required? ? 'always' : 'conditionally')
|
21
22
|
|
22
|
-
|
23
|
+
log_messages << format(responder_topic.name, "(#{features.join(', ')})")
|
23
24
|
end
|
24
25
|
else
|
25
|
-
|
26
|
+
log_messages << "#{topic.name} => (nothing)"
|
26
27
|
end
|
28
|
+
|
29
|
+
Karafka.logger.info(log_messages.join("\n"))
|
27
30
|
end
|
28
31
|
end
|
29
32
|
|
@@ -34,15 +37,11 @@ module Karafka
|
|
34
37
|
Karafka::App.consumer_groups.map(&:topics).flatten.sort_by(&:name)
|
35
38
|
end
|
36
39
|
|
37
|
-
#
|
40
|
+
# Formats a given value with label in a nice way
|
38
41
|
# @param label [String] label describing value
|
39
42
|
# @param value [String] value that should be printed
|
40
|
-
def
|
41
|
-
|
42
|
-
"%<label>-25s %<value>s\n",
|
43
|
-
label: " - #{label}:",
|
44
|
-
value: value
|
45
|
-
)
|
43
|
+
def format(label, value)
|
44
|
+
" - #{label}: #{value}"
|
46
45
|
end
|
47
46
|
end
|
48
47
|
end
|