karafka 1.4.0 → 1.4.13

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: 45788f5dd509d8a61a1480ff5c1b41f89b683d2100e0dcedaf6e35e6ce3af447
4
- data.tar.gz: d5e5638fd2a83b91f78cf1f38d03bd2594fb562a0cc8ad6cf2e45f60e72cc692
3
+ metadata.gz: 8799d5854288a36f4af9e7688241a0df2719a7d982fe4940d9d7acec80ec8389
4
+ data.tar.gz: 7d17c4de581aa08467c8c810f8a2977a8e7cffa1f0f68f2ff369e39bc15f888b
5
5
  SHA512:
6
- metadata.gz: 75b2863022df6dc78f23ca557450a9757e137d110f9a6c49a29f572cd701863143e638394c341e8f982bdce4255df923879c8410ce081503c43e3f9a0ce2e777
7
- data.tar.gz: ec0eee525c34634d15b04c85a492e329d4749f179ff2c21d3ce2e50cccb4b6d061465c13df322a026b8924974f743277448464db818e13d73ef90f5ce930f796
6
+ metadata.gz: f43dc6e07e61671aff52a9200333945e93b3641e63a44ff5d877456278553040f5ba2e6dbf69f30570d974bcaa6010312b66da5aee478f7d356b3268a62428a2
7
+ data.tar.gz: 87f1ed908bfc5f3076c42bec507c916900881e7536f23822d38fd8cd0214b0fdedb58a6d6920e8f11dd0e035c6ec301bfb217f906d129873b2b5a8df20d18e53
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
@@ -40,6 +44,26 @@ jobs:
40
44
  env:
41
45
  GITHUB_COVERAGE: ${{matrix.coverage}}
42
46
  run: bundle exec rspec
47
+
48
+ diffend:
49
+ runs-on: ubuntu-latest
50
+ strategy:
51
+ fail-fast: false
52
+ steps:
53
+ - uses: actions/checkout@v2
54
+ with:
55
+ fetch-depth: 0
56
+ - name: Set up Ruby
57
+ uses: ruby/setup-ruby@v1
58
+ with:
59
+ ruby-version: 3.1
60
+ - name: Install latest bundler
61
+ run: gem install bundler --no-document
62
+ - name: Install Diffend plugin
63
+ run: bundle plugin install diffend
64
+ - name: Bundle Secure
65
+ run: bundle secure
66
+
43
67
  coditsu:
44
68
  runs-on: ubuntu-latest
45
69
  strategy:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.1
1
+ 3.1.0
data/CHANGELOG.md CHANGED
@@ -1,8 +1,55 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 1.4.13 (2022-02-19)
4
+ - Drop support for ruby 2.6
5
+ - Add mfa requirement
6
+
7
+ ## 1.4.12 (2022-01-13)
8
+ - Ruby 3.1 support
9
+ - `irb` dependency removal (vbyno)
10
+
11
+ ## 1.4.11 (2021-12-04)
12
+ - Source code metadata url added to the gemspec
13
+ - Gem bump
14
+
15
+ ## 1.4.10 (2021-10-30)
16
+ - update gems requirements in the gemspec (nijikon)
17
+
18
+ ## 1.4.9 (2021-09-29)
19
+ - fix `dry-configurable` deprecation warnings for default value as positional argument
20
+
21
+ ## 1.4.8 (2021-09-08)
22
+ - Allow 'rails' in Gemfile to enable rails-aware generator (rewritten)
23
+
24
+ ## 1.4.7 (2021-09-04)
25
+ - Update ruby-kafka to `1.4.0`
26
+ - Support for `resolve_seed_brokers` option (with Azdaroth)
27
+ - Set minimum `ruby-kafka` requirement to `1.3.0`
28
+
29
+ ## 1.4.6 (2021-08-05)
30
+ - #700 Fix Ruby 3 compatibility issues in Connection::Client#pause (MmKolodziej)
31
+
32
+ ## 1.4.5 (2021-06-16)
33
+ - Fixup logger checks for non-writeable logfile (ojab)
34
+ - #689 - Update the stdout initialization message for framework initialization
35
+
36
+ ## 1.4.4 (2021-04-19)
37
+ - Remove Ruby 2.5 support and update minimum Ruby requirement to 2.6
38
+ - Remove rake dependency
39
+
40
+ ## 1.4.3 (2021-03-24)
41
+ - Fixes for Ruby 3.0 compatibility
42
+
43
+ ## 1.4.2 (2021-02-16)
44
+ - Rescue Errno::EROFS in ensure_dir_exists (unasuke)
45
+
46
+ ## 1.4.1 (2020-12-04)
47
+ - Return non-zero exit code when printing usage
48
+ - Add support for :assignment_strategy for consumers
49
+
3
50
  ## 1.4.0 (2020-09-05)
4
51
  - Rename `Karafka::Params::Metadata` to `Karafka::Params::BatchMetadata`
5
- ` Rename consumer `#metadata` to `#batch_metadata`
52
+ - Rename consumer `#metadata` to `#batch_metadata`
6
53
  - Separate metadata (including Karafka native metadata) from the root of params (backwards compatibility preserved thanks to rabotyaga)
7
54
  - Remove metadata hash dependency
8
55
  - Remove params dependency on a hash in favour of PORO
data/Gemfile.lock CHANGED
@@ -1,132 +1,118 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (1.4.0)
5
- dry-configurable (~> 0.8)
6
- dry-inflector (~> 0.1)
7
- dry-monitor (~> 0.3)
8
- dry-validation (~> 1.2)
4
+ karafka (1.4.13)
5
+ dry-configurable (~> 0.13)
6
+ dry-inflector (~> 0.2)
7
+ dry-monitor (~> 0.5)
8
+ dry-validation (~> 1.7)
9
9
  envlogic (~> 1.1)
10
- irb (~> 1.0)
11
- rake (>= 11.3)
12
- ruby-kafka (>= 1.0.0)
13
- thor (>= 0.20)
14
- waterdrop (~> 1.4.0)
15
- zeitwerk (~> 2.1)
10
+ ruby-kafka (>= 1.3.0)
11
+ thor (>= 1.1)
12
+ waterdrop (~> 1.4)
13
+ zeitwerk (~> 2.4)
16
14
 
17
15
  GEM
18
16
  remote: https://rubygems.org/
19
17
  specs:
20
- activesupport (6.0.3.2)
18
+ activesupport (7.0.1)
21
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
22
- i18n (>= 0.7, < 2)
23
- minitest (~> 5.1)
24
- tzinfo (~> 1.1)
25
- zeitwerk (~> 2.2, >= 2.2.2)
20
+ i18n (>= 1.6, < 2)
21
+ minitest (>= 5.1)
22
+ tzinfo (~> 2.0)
26
23
  byebug (11.1.3)
27
- concurrent-ruby (1.1.7)
28
- delivery_boy (1.0.1)
29
- king_konf (~> 0.3)
24
+ concurrent-ruby (1.1.9)
25
+ delivery_boy (1.1.0)
26
+ king_konf (~> 1.0)
30
27
  ruby-kafka (~> 1.0)
31
- diff-lcs (1.4.4)
32
- digest-crc (0.6.1)
33
- rake (~> 13.0)
34
- docile (1.3.2)
35
- dry-configurable (0.11.6)
28
+ diff-lcs (1.5.0)
29
+ digest-crc (0.6.4)
30
+ rake (>= 12.0.0, < 14.0.0)
31
+ docile (1.4.0)
32
+ dry-configurable (0.14.0)
36
33
  concurrent-ruby (~> 1.0)
37
- dry-core (~> 0.4, >= 0.4.7)
38
- dry-equalizer (~> 0.2)
39
- dry-container (0.7.2)
34
+ dry-core (~> 0.6)
35
+ dry-container (0.9.0)
40
36
  concurrent-ruby (~> 1.0)
41
- dry-configurable (~> 0.1, >= 0.1.3)
42
- dry-core (0.4.9)
37
+ dry-configurable (~> 0.13, >= 0.13.0)
38
+ dry-core (0.7.1)
43
39
  concurrent-ruby (~> 1.0)
44
- dry-equalizer (0.3.0)
45
- dry-events (0.2.0)
40
+ dry-events (0.3.0)
46
41
  concurrent-ruby (~> 1.0)
47
- dry-core (~> 0.4)
48
- dry-equalizer (~> 0.2)
49
- dry-inflector (0.2.0)
50
- dry-initializer (3.0.3)
51
- dry-logic (1.0.7)
42
+ dry-core (~> 0.5, >= 0.5)
43
+ dry-inflector (0.2.1)
44
+ dry-initializer (3.1.1)
45
+ dry-logic (1.2.0)
52
46
  concurrent-ruby (~> 1.0)
53
- dry-core (~> 0.2)
54
- dry-equalizer (~> 0.2)
55
- dry-monitor (0.3.2)
56
- dry-configurable (~> 0.5)
57
- dry-core (~> 0.4)
58
- dry-equalizer (~> 0.2)
47
+ dry-core (~> 0.5, >= 0.5)
48
+ dry-monitor (0.5.0)
49
+ dry-configurable (~> 0.13, >= 0.13.0)
50
+ dry-core (~> 0.5, >= 0.5)
59
51
  dry-events (~> 0.2)
60
- dry-schema (1.5.4)
52
+ dry-schema (1.9.1)
61
53
  concurrent-ruby (~> 1.0)
62
- dry-configurable (~> 0.8, >= 0.8.3)
63
- dry-core (~> 0.4)
64
- dry-equalizer (~> 0.2)
54
+ dry-configurable (~> 0.13, >= 0.13.0)
55
+ dry-core (~> 0.5, >= 0.5)
65
56
  dry-initializer (~> 3.0)
66
57
  dry-logic (~> 1.0)
67
- dry-types (~> 1.4)
68
- dry-types (1.4.0)
58
+ dry-types (~> 1.5)
59
+ dry-types (1.5.1)
69
60
  concurrent-ruby (~> 1.0)
70
61
  dry-container (~> 0.3)
71
- dry-core (~> 0.4, >= 0.4.4)
72
- dry-equalizer (~> 0.3)
62
+ dry-core (~> 0.5, >= 0.5)
73
63
  dry-inflector (~> 0.1, >= 0.1.2)
74
64
  dry-logic (~> 1.0, >= 1.0.2)
75
- dry-validation (1.5.6)
65
+ dry-validation (1.8.0)
76
66
  concurrent-ruby (~> 1.0)
77
67
  dry-container (~> 0.7, >= 0.7.1)
78
- dry-core (~> 0.4)
79
- dry-equalizer (~> 0.2)
68
+ dry-core (~> 0.5, >= 0.5)
80
69
  dry-initializer (~> 3.0)
81
- dry-schema (~> 1.5, >= 1.5.2)
82
- envlogic (1.1.2)
70
+ dry-schema (~> 1.9, >= 1.9.1)
71
+ envlogic (1.1.4)
83
72
  dry-inflector (~> 0.1)
84
- factory_bot (6.1.0)
73
+ factory_bot (6.2.0)
85
74
  activesupport (>= 5.0.0)
86
- i18n (1.8.5)
75
+ i18n (1.9.1)
87
76
  concurrent-ruby (~> 1.0)
88
- io-console (0.5.6)
89
- irb (1.2.4)
90
- reline (>= 0.0.1)
91
- king_konf (0.3.7)
92
- minitest (5.14.2)
93
- rake (13.0.1)
94
- reline (0.1.4)
95
- io-console (~> 0.5)
96
- rspec (3.9.0)
97
- rspec-core (~> 3.9.0)
98
- rspec-expectations (~> 3.9.0)
99
- rspec-mocks (~> 3.9.0)
100
- rspec-core (3.9.2)
101
- rspec-support (~> 3.9.3)
102
- rspec-expectations (3.9.2)
77
+ king_konf (1.0.0)
78
+ minitest (5.15.0)
79
+ rake (13.0.6)
80
+ rspec (3.10.0)
81
+ rspec-core (~> 3.10.0)
82
+ rspec-expectations (~> 3.10.0)
83
+ rspec-mocks (~> 3.10.0)
84
+ rspec-core (3.10.2)
85
+ rspec-support (~> 3.10.0)
86
+ rspec-expectations (3.10.2)
103
87
  diff-lcs (>= 1.2.0, < 2.0)
104
- rspec-support (~> 3.9.0)
105
- rspec-mocks (3.9.1)
88
+ rspec-support (~> 3.10.0)
89
+ rspec-mocks (3.10.3)
106
90
  diff-lcs (>= 1.2.0, < 2.0)
107
- rspec-support (~> 3.9.0)
108
- rspec-support (3.9.3)
109
- ruby-kafka (1.2.0)
91
+ rspec-support (~> 3.10.0)
92
+ rspec-support (3.10.3)
93
+ ruby-kafka (1.4.0)
110
94
  digest-crc
111
- simplecov (0.19.0)
95
+ simplecov (0.21.2)
112
96
  docile (~> 1.1)
113
97
  simplecov-html (~> 0.11)
114
- simplecov-html (0.12.2)
115
- thor (1.0.1)
116
- thread_safe (0.3.6)
117
- tzinfo (1.2.7)
118
- thread_safe (~> 0.1)
119
- waterdrop (1.4.0)
98
+ simplecov_json_formatter (~> 0.1)
99
+ simplecov-html (0.12.3)
100
+ simplecov_json_formatter (0.1.3)
101
+ thor (1.2.1)
102
+ tzinfo (2.0.4)
103
+ concurrent-ruby (~> 1.0)
104
+ waterdrop (1.4.4)
120
105
  delivery_boy (>= 0.2, < 2.x)
121
- dry-configurable (~> 0.8)
122
- dry-monitor (~> 0.3)
123
- dry-validation (~> 1.2)
124
- ruby-kafka (>= 0.7.8)
125
- zeitwerk (~> 2.1)
126
- zeitwerk (2.4.0)
106
+ dry-configurable (~> 0.13)
107
+ dry-monitor (~> 0.5)
108
+ dry-validation (~> 1.7)
109
+ ruby-kafka (>= 1.3.0)
110
+ zeitwerk (~> 2.4)
111
+ zeitwerk (2.5.4)
127
112
 
128
113
  PLATFORMS
129
- ruby
114
+ x86_64-darwin
115
+ x86_64-linux
130
116
 
131
117
  DEPENDENCIES
132
118
  byebug
@@ -136,4 +122,4 @@ DEPENDENCIES
136
122
  simplecov
137
123
 
138
124
  BUNDLED WITH
139
- 2.1.4
125
+ 2.3.6
data/README.md CHANGED
@@ -1,15 +1,33 @@
1
1
  ![karafka logo](https://raw.githubusercontent.com/karafka/misc/master/logo/karafka_logotype_transparent2.png)
2
2
 
3
- [![Build Status](https://travis-ci.org/karafka/karafka.svg?branch=master)](https://travis-ci.org/karafka/karafka)
3
+ [![Build Status](https://github.com/karafka/karafka/actions/workflows/ci.yml/badge.svg)](https://github.com/karafka/karafka/actions/workflows/ci.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/karafka.svg)](http://badge.fury.io/rb/karafka)
5
+ [![Join the chat at https://slack.karafka.io](https://raw.githubusercontent.com/karafka/misc/master/slack.svg)](https://slack.karafka.io)
4
6
 
5
- **Note**: Documentation presented here refers to Karafka `1.4`.
6
-
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).
7
+ **Note**: We're finishing the new Karafka `2.0` but for now, please use `1.4`. All the documentation presented here refers to `1.4`
8
8
 
9
9
  ## About Karafka
10
10
 
11
11
  Framework used to simplify Apache Kafka based Ruby applications development.
12
12
 
13
+ ```ruby
14
+ # Define what topics you want to consume with which consumers
15
+ Karafka::App.consumer_groups.draw do
16
+ topic 'system_events' do
17
+ consumer EventsConsumer
18
+ end
19
+ end
20
+
21
+ # And create your consumers, within which your messages will be processed
22
+ class EventsConsumer < ApplicationConsumer
23
+ # Example that utilizes ActiveRecord#insert_all and Karafka batch processing
24
+ def consume
25
+ # Store all of the incoming Kafka events locally in an efficient way
26
+ Event.insert_all params_batch.payloads
27
+ end
28
+ end
29
+ ```
30
+
13
31
  Karafka allows you to capture everything that happens in your systems in large scale, providing you with a seamless and stable core for consuming and processing this data, without having to focus on things that are not your business domain.
14
32
 
15
33
  Karafka not only handles incoming messages but also provides tools for building complex data-flow applications that receive and send messages.
@@ -35,7 +53,7 @@ Karafka based applications can be easily deployed to any type of infrastructure,
35
53
 
36
54
  ## Support
37
55
 
38
- Karafka has a [Wiki pages](https://github.com/karafka/karafka/wiki) for almost everything and a pretty decent [FAQ](https://github.com/karafka/karafka/wiki/FAQ). It covers the whole installation, setup, and deployment along with other useful details on how to run Karafka.
56
+ Karafka has [Wiki pages](https://github.com/karafka/karafka/wiki) for almost everything and a pretty decent [FAQ](https://github.com/karafka/karafka/wiki/FAQ). It covers the whole installation, setup, and deployment along with other useful details on how to run Karafka.
39
57
 
40
58
  If you have any questions about using Karafka, feel free to join our [Gitter](https://gitter.im/karafka/karafka) chat channel.
41
59
 
@@ -65,35 +83,16 @@ and follow the instructions from the [example app Wiki](https://github.com/karaf
65
83
 
66
84
  If you need more details and know how on how to start Karafka with a clean installation, read the [Getting started page](https://github.com/karafka/karafka/wiki/Getting-started) section of our Wiki.
67
85
 
68
- ## Notice
69
-
70
- Karafka framework and Karafka team are __not__ related to Kafka streaming service called CloudKarafka in any matter. We don't recommend nor discourage usage of their platform.
71
-
72
86
  ## References
73
87
 
74
88
  * [Karafka framework](https://github.com/karafka/karafka)
75
- * [Karafka Travis CI](https://travis-ci.org/karafka/karafka)
89
+ * [Karafka GitHub Actions](https://github.com/karafka/karafka/actions)
76
90
  * [Karafka Coditsu](https://app.coditsu.io/karafka/repositories/karafka)
77
91
 
78
92
  ## Note on contributions
79
93
 
80
- First, thank you for considering contributing to Karafka! It's people like you that make the open source community such a great community!
81
-
82
- Each pull request must pass all the RSpec specs and meet our quality requirements.
83
-
84
- 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.
85
-
86
- 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/commit_builds) of Karafka organization.
87
-
88
- [![coditsu](https://coditsu.io/assets/quality_bar.svg)](https://app.coditsu.io/karafka/commit_builds)
89
-
90
- ## Contributors
91
-
92
- This project exists thanks to all the people who contribute.
93
- <a href="https://github.com/karafka/karafka/graphs/contributors"><img src="https://opencollective.com/karafka/contributors.svg?width=890" /></a>
94
-
95
- ## Sponsors
94
+ 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!
96
95
 
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.
96
+ Each pull request must pass all the RSpec specs, integration tests and meet our quality requirements.
98
97
 
99
- Please contact [Maciej Mensfeld](mailto:maciej@mensfeld.pl) directly for more details.
98
+ 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
- N7IqnPUgexe1fbZArwQ51afxz2AmPQN2BkB2oeQHXxnSWUGMhvcEZpfbxCCJH26w
8
- hS0Ccsma8yxA6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
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-----
data/config/errors.yml CHANGED
@@ -37,3 +37,5 @@ en:
37
37
  Unknown consumer group
38
38
  does_not_exist:
39
39
  Given file does not exist or cannot be read
40
+ does_not_respond_to_call: >
41
+ needs to respond to a #call method
data/karafka.gemspec CHANGED
@@ -12,24 +12,22 @@ Gem::Specification.new do |spec|
12
12
  spec.platform = Gem::Platform::RUBY
13
13
  spec.authors = ['Maciej Mensfeld', 'Pavlo Vavruk', 'Adam Gwozdowski']
14
14
  spec.email = %w[maciej@mensfeld.pl pavlo.vavruk@gmail.com adam99g@gmail.com]
15
- spec.homepage = 'https://github.com/karafka/karafka'
15
+ spec.homepage = 'https://karafka.io'
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'
18
18
  spec.license = 'MIT'
19
19
 
20
- spec.add_dependency 'dry-configurable', '~> 0.8'
21
- spec.add_dependency 'dry-inflector', '~> 0.1'
22
- spec.add_dependency 'dry-monitor', '~> 0.3'
23
- spec.add_dependency 'dry-validation', '~> 1.2'
20
+ spec.add_dependency 'dry-configurable', '~> 0.13'
21
+ spec.add_dependency 'dry-inflector', '~> 0.2'
22
+ spec.add_dependency 'dry-monitor', '~> 0.5'
23
+ spec.add_dependency 'dry-validation', '~> 1.7'
24
24
  spec.add_dependency 'envlogic', '~> 1.1'
25
- spec.add_dependency 'irb', '~> 1.0'
26
- spec.add_dependency 'rake', '>= 11.3'
27
- spec.add_dependency 'ruby-kafka', '>= 1.0.0'
28
- spec.add_dependency 'thor', '>= 0.20'
29
- spec.add_dependency 'waterdrop', '~> 1.4.0'
30
- spec.add_dependency 'zeitwerk', '~> 2.1'
25
+ spec.add_dependency 'ruby-kafka', '>= 1.3.0'
26
+ spec.add_dependency 'thor', '>= 1.1'
27
+ spec.add_dependency 'waterdrop', '~> 1.4'
28
+ spec.add_dependency 'zeitwerk', '~> 2.4'
31
29
 
32
- spec.required_ruby_version = '>= 2.5.0'
30
+ spec.required_ruby_version = '>= 2.7'
33
31
 
34
32
  if $PROGRAM_NAME.end_with?('gem')
35
33
  spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
@@ -39,5 +37,10 @@ Gem::Specification.new do |spec|
39
37
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
40
38
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
41
39
  spec.require_paths = %w[lib]
40
+
41
+ spec.metadata = {
42
+ 'source_code_uri' => 'https://github.com/karafka/karafka',
43
+ 'rubygems_mfa_required' => 'true'
44
+ }
42
45
  end
43
46
  # rubocop:enable Metrics/BlockLength
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ # Strategies for Kafka partitions assignments
5
+ module AssignmentStrategies
6
+ # Standard RoundRobin strategy
7
+ class RoundRobin < SimpleDelegator
8
+ def initialize
9
+ super(Kafka::RoundRobinAssignmentStrategy.new)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -19,6 +19,7 @@ module Karafka
19
19
  consumer: %i[
20
20
  session_timeout offset_commit_interval offset_commit_threshold
21
21
  offset_retention_time heartbeat_interval fetcher_max_queue_size
22
+ assignment_strategy
22
23
  ],
23
24
  subscribe: %i[start_from_beginning max_bytes_per_partition],
24
25
  consumption: %i[min_bytes max_bytes max_wait_time],
@@ -43,16 +43,16 @@ module Karafka
43
43
  end
44
44
 
45
45
  # Allows to set description of a given cli command
46
- # @param desc [String] Description of a given cli command
47
- def desc(desc)
48
- @desc ||= desc
46
+ # @param args [Array] All the arguments that Thor desc method accepts
47
+ def desc(*args)
48
+ @desc ||= args
49
49
  end
50
50
 
51
51
  # This method will bind a given Cli command into Karafka Cli
52
52
  # This method is a wrapper to way Thor defines its commands
53
53
  # @param cli_class [Karafka::Cli] Karafka cli_class
54
54
  def bind_to(cli_class)
55
- cli_class.desc name, @desc
55
+ cli_class.desc name, *@desc
56
56
 
57
57
  (@options || []).each { |option| cli_class.option(*option) }
58
58
 
@@ -30,11 +30,12 @@ module Karafka
30
30
  # @param args [Array] all the things that Thor CLI accepts
31
31
  def initialize(*args)
32
32
  super
33
- @rails = Bundler::LockfileParser.new(
33
+ dependencies = Bundler::LockfileParser.new(
34
34
  Bundler.read_file(
35
35
  Bundler.default_lockfile
36
36
  )
37
- ).dependencies.key?('rails')
37
+ ).dependencies
38
+ @rails = dependencies.key?('railties') || dependencies.key?('rails')
38
39
  end
39
40
 
40
41
  # Install all required things for Karafka application in current directory
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ class Cli < Thor
5
+ # Command that gets invoked when no method is provided when running the CLI
6
+ # It allows us to exit with exit code 1 instead of default 0 to indicate that something
7
+ # was missing
8
+ # @see https://github.com/karafka/karafka/issues/619
9
+ class Missingno < Base
10
+ desc 'Hidden command that gets invoked when no command is provided', hide: true
11
+
12
+ # Prints an error about the lack of command (nothing selected)
13
+ def call
14
+ Karafka.logger.error('No command provided')
15
+ exit 1
16
+ end
17
+ end
18
+ end
19
+ end
@@ -31,14 +31,6 @@ module Karafka
31
31
  # part of the topics
32
32
  Karafka::Server.consumer_groups = cli.options[:consumer_groups]
33
33
 
34
- # Remove pidfile on stop, just before the server instance is going to be GCed
35
- # We want to delay the moment in which the pidfile is removed as much as we can,
36
- # so instead of removing it after the server stops running, we rely on the gc moment
37
- # when this object gets removed (it is a bit later), so it is closer to the actual
38
- # system process end. We do that, so monitoring and deployment tools that rely on a pid
39
- # won't alarm or start new system process up until the current one is finished
40
- ObjectSpace.define_finalizer(self, proc { send(:clean) })
41
-
42
34
  Karafka::Server.run
43
35
  end
44
36
 
@@ -60,6 +52,14 @@ module Karafka
60
52
  cli.options[:pid],
61
53
  'w'
62
54
  ) { |file| file.write(::Process.pid) }
55
+
56
+ # Remove pidfile on stop, just before the server instance is going to be GCed
57
+ # We want to delay the moment in which the pidfile is removed as much as we can,
58
+ # so instead of removing it after the server stops running, we rely on the gc moment
59
+ # when this object gets removed (it is a bit later), so it is closer to the actual
60
+ # system process end. We do that, so monitoring and deployment tools that rely on a pid
61
+ # won't alarm or start new system process up until the current one is finished
62
+ ObjectSpace.define_finalizer(self, proc { send(:clean) })
63
63
  end
64
64
 
65
65
  # Removes a pidfile (if exist)