karafka 1.3.4 → 1.4.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.diffend.yml +3 -0
  5. data/.github/workflows/ci.yml +52 -0
  6. data/.ruby-version +1 -1
  7. data/CHANGELOG.md +30 -1
  8. data/CODE_OF_CONDUCT.md +1 -1
  9. data/Gemfile +2 -0
  10. data/Gemfile.lock +39 -40
  11. data/README.md +3 -5
  12. data/certs/mensfeld.pem +21 -21
  13. data/docker-compose.yml +17 -0
  14. data/karafka.gemspec +3 -4
  15. data/lib/karafka.rb +1 -1
  16. data/lib/karafka/cli.rb +1 -1
  17. data/lib/karafka/cli/flow.rb +9 -10
  18. data/lib/karafka/cli/info.rb +1 -1
  19. data/lib/karafka/connection/api_adapter.rb +12 -6
  20. data/lib/karafka/connection/batch_delegator.rb +5 -1
  21. data/lib/karafka/connection/builder.rb +4 -2
  22. data/lib/karafka/connection/client.rb +1 -1
  23. data/lib/karafka/consumers/batch_metadata.rb +10 -0
  24. data/lib/karafka/consumers/includer.rb +5 -4
  25. data/lib/karafka/instrumentation/stdout_listener.rb +4 -2
  26. data/lib/karafka/params/batch_metadata.rb +26 -0
  27. data/lib/karafka/params/builders/batch_metadata.rb +30 -0
  28. data/lib/karafka/params/builders/params.rb +17 -15
  29. data/lib/karafka/params/builders/params_batch.rb +2 -2
  30. data/lib/karafka/params/metadata.rb +14 -29
  31. data/lib/karafka/params/params.rb +27 -41
  32. data/lib/karafka/params/params_batch.rb +15 -16
  33. data/lib/karafka/serialization/json/deserializer.rb +2 -2
  34. data/lib/karafka/server.rb +4 -1
  35. data/lib/karafka/setup/config.rb +2 -0
  36. data/lib/karafka/version.rb +1 -1
  37. metadata +37 -48
  38. metadata.gz.sig +0 -0
  39. data/.travis.yml +0 -36
  40. data/lib/karafka/consumers/metadata.rb +0 -10
  41. data/lib/karafka/params/builders/metadata.rb +0 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddf68ae4e3a502480b2cdede179dca9a62a89e61cd0f7878fdf46629b4204437
4
- data.tar.gz: 3e0ba01212a750838e946d73216b7dd5b02a19d3a9ac55d094bafbe800af511b
3
+ metadata.gz: 62798b3cc6f5f12fd89e13e4f1163aaf6f759d9cebf7862b591e7d3c6603bfc3
4
+ data.tar.gz: f4b416b014de9d6b4da282735014d5e16ec4195db01b98798764efc7a9c8ce8d
5
5
  SHA512:
6
- metadata.gz: 056b083736bf303d2de7f9aefa83151229b6a8c6f8e6b279c2e06eee41047b1dd31d3361a7b101b9a34572dd22934ac136f1fbb41771e8070cb2ffb24e5f4b1a
7
- data.tar.gz: 53da753b3835e0c8621a80adcdc0992a7737a3bce1cf0563a27ce76391d4fecc7c55c9d927cd675bf7096074081b2e91073c3a30bbeabcc6c919067812a5a595
6
+ metadata.gz: 47848c70c13d6456c863e9c0811e08084f9ad1710ac299e2a954eed08e5b283eb990333c4443bfcaf70929d1fc85d597ff820b5321016fe19ef4d78951dd2853
7
+ data.tar.gz: 961cfbc6c5be4acef1c897c685f591c1549c92ea95f438013ce405f073b1e85745b4413a726017bed8b328a76d100bdd4fc1f9b74eeffd6bca0561e2d4d7632c
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -0,0 +1,3 @@
1
+ project_id: 'de9b9933-7610-4cc4-b69b-f7e3e3c5e797'
2
+ shareable_id: '68a8c626-b605-40ad-ac45-e3961ad7c57d'
3
+ shareable_key: 'a3ec2dac-fba2-4b6c-b181-49e927b15057'
@@ -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
@@ -1 +1 @@
1
- 2.7.0
1
+ 2.7.1
@@ -1,5 +1,34 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 1.4.0.rc2 (2020-08-25)
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 preseverd 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
+
29
+ ## 1.3.5 (2020-04-02)
30
+ - #578 - ThreadError: can't be called from trap context patch
31
+
3
32
  ## 1.3.4 (2020-02-17)
4
33
  - `dry-configurable` upgrade (solnic)
5
34
  - Remove temporary `thor` patches that are no longer needed
@@ -75,6 +104,7 @@
75
104
  - #508 - Reset the consumers instances upon reconnecting to a cluster
76
105
  - [#530](https://github.com/karafka/karafka/pull/530) - expose ruby and ruby-kafka version
77
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
78
108
 
79
109
  ## 1.2.11
80
110
  - [#470](https://github.com/karafka/karafka/issues/470) Karafka not working with dry-configurable 0.8
@@ -113,7 +143,6 @@
113
143
  - #318 - Partition pausing doesn't work with custom topic mappers
114
144
  - Rename ConfigAdapter to ApiAdapter to better reflect what it does
115
145
  - #317 - Manual offset committing doesn't work with custom topic mappers
116
- - #319 - Support for exponential backoff in pause
117
146
 
118
147
  ## 1.2.2
119
148
  - #312 - Broken for ActiveSupport 5.2.0
@@ -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@coditsu.io. 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.
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
@@ -2,6 +2,8 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ plugin 'diffend'
6
+
5
7
  gemspec
6
8
 
7
9
  group :test do
@@ -1,38 +1,38 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (1.3.4)
4
+ karafka (1.4.0.rc2)
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.7.8)
12
+ ruby-kafka (>= 1.0.0)
14
13
  thor (>= 0.20)
15
- waterdrop (~> 1.3.0)
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.2.1)
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.1)
28
- concurrent-ruby (1.1.6)
29
- delivery_boy (1.0.0)
25
+ zeitwerk (~> 2.2, >= 2.2.2)
26
+ byebug (11.1.3)
27
+ concurrent-ruby (1.1.7)
28
+ delivery_boy (1.0.1)
30
29
  king_konf (~> 0.3)
31
- ruby-kafka (~> 0.7.8)
32
- diff-lcs (1.3)
33
- digest-crc (0.4.1)
30
+ ruby-kafka (~> 1.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.0)
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,83 +48,82 @@ 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.6)
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.1)
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.1)
60
- dry-schema (1.4.3)
59
+ dry-events (~> 0.2)
60
+ dry-schema (1.5.3)
61
61
  concurrent-ruby (~> 1.0)
62
62
  dry-configurable (~> 0.8, >= 0.8.3)
63
63
  dry-core (~> 0.4)
64
64
  dry-equalizer (~> 0.2)
65
65
  dry-initializer (~> 3.0)
66
66
  dry-logic (~> 1.0)
67
- dry-types (~> 1.2)
68
- dry-types (1.3.1)
67
+ dry-types (~> 1.4)
68
+ dry-types (1.4.0)
69
69
  concurrent-ruby (~> 1.0)
70
70
  dry-container (~> 0.3)
71
71
  dry-core (~> 0.4, >= 0.4.4)
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.4.2)
75
+ dry-validation (1.5.4)
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.4, >= 1.4.3)
82
- envlogic (1.1.0)
81
+ dry-schema (~> 1.5)
82
+ envlogic (1.1.2)
83
83
  dry-inflector (~> 0.1)
84
- factory_bot (5.1.1)
85
- activesupport (>= 4.2.0)
86
- i18n (1.8.2)
84
+ factory_bot (6.1.0)
85
+ activesupport (>= 5.0.0)
86
+ i18n (1.8.5)
87
87
  concurrent-ruby (~> 1.0)
88
- io-console (0.5.5)
89
- irb (1.2.3)
88
+ io-console (0.5.6)
89
+ irb (1.2.4)
90
90
  reline (>= 0.0.1)
91
91
  king_konf (0.3.7)
92
- minitest (5.14.0)
93
- multi_json (1.14.1)
92
+ minitest (5.14.1)
94
93
  rake (13.0.1)
95
- reline (0.1.3)
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.1)
102
- rspec-support (~> 3.9.1)
103
- rspec-expectations (3.9.0)
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.2)
110
- ruby-kafka (0.7.10)
108
+ rspec-support (3.9.3)
109
+ ruby-kafka (1.2.0)
111
110
  digest-crc
112
- simplecov (0.18.2)
111
+ simplecov (0.19.0)
113
112
  docile (~> 1.1)
114
113
  simplecov-html (~> 0.11)
115
- simplecov-html (0.12.0)
114
+ simplecov-html (0.12.2)
116
115
  thor (1.0.1)
117
116
  thread_safe (0.3.6)
118
- tzinfo (1.2.6)
117
+ tzinfo (1.2.7)
119
118
  thread_safe (~> 0.1)
120
- waterdrop (1.3.3)
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.2.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.3.0`.
5
+ **Note**: Documentation presented here refers to **not yet** released Karafka `1.4.x`.
6
6
 
7
- If you're upgrading from `1.2.0`, please refer to our [Upgrade Notes article](https://mensfeld.pl/2019/09/karafka-framework-1-3-0-release-notes-ruby-kafka/).
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@coditsu.io) directly for more details.
99
+ Please contact [Maciej Mensfeld](mailto:maciej@mensfeld.pl) directly for more details.
@@ -1,25 +1,25 @@
1
1
  -----BEGIN CERTIFICATE-----
2
2
  MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhtYWNp
3
- ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMTkwNzMwMTQ1NDU0WhcNMjAwNzI5MTQ1
4
- NDU0WjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
5
- CSqGSIb3DQEBAQUAA4IBjw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ZgTZC5rvD0nNS5sFNQ==
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-----
@@ -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
@@ -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@coditsu.io pavlo.vavruk@gmail.com adam99g@gmail.com]
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.7.8'
27
+ spec.add_dependency 'ruby-kafka', '>= 1.0.0'
29
28
  spec.add_dependency 'thor', '>= 0.20'
30
- spec.add_dependency 'waterdrop', '~> 1.3.0'
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'
@@ -6,10 +6,10 @@
6
6
  waterdrop
7
7
  kafka
8
8
  envlogic
9
+ json
9
10
  thor
10
11
  forwardable
11
12
  fileutils
12
- multi_json
13
13
  dry-configurable
14
14
  dry-validation
15
15
  dry/events/publisher
@@ -47,7 +47,7 @@ end
47
47
  if ENV['KARAFKA_CONSOLE']
48
48
  # Reloads Karafka irb console session
49
49
  def reload!
50
- puts "Reloading...\n"
50
+ Karafka.logger.info "Reloading...\n"
51
51
  Kernel.exec Karafka::Cli::Console.command
52
52
  end
53
53
  end
@@ -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
- puts "#{topic.name} =>"
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
- print responder_topic.name, "(#{features.join(', ')})"
23
+ log_messages << format(responder_topic.name, "(#{features.join(', ')})")
23
24
  end
24
25
  else
25
- puts "#{topic.name} => (nothing)"
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
- # Prints a given value with label in a nice way
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 print(label, value)
41
- printf(
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