karafka 1.3.2 → 1.3.7

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: a89f790b57a8908107363b346d17e09d9d013ad697f4c802203cb6bfe126b7e9
4
- data.tar.gz: ee325ee157b1f23afc8235c144672c07584f0377068db2ede804c3cb2a8c9596
3
+ metadata.gz: a4a06a7ae9c8de9ada4f029b4aa8c0e5946d127eed891c0676dc6cfa92d61aaa
4
+ data.tar.gz: 532c931751da662fe1b0aa7b4c5361effd710d7112a39fd094c93a3846bd04e9
5
5
  SHA512:
6
- metadata.gz: 68b386d626998e78fe30c2bbed66794e76065947ff48b1b2dc904a70f329364c70fb9b80b1ff3a8e46b167d2e9bdacc1ff180bbd902235d0cb3eb74d0c4d8662
7
- data.tar.gz: 946fc02d0ea56f30bea98947a2f47d950e1b88674abfe14bd1c3069460f375c059bd5cf537ea9a31bc5849abedfa62905b854206f780bd95847b995316defd15
6
+ metadata.gz: 56e43f67ef345d2a9f528be97107fa84d1a5d13f343bcc43ae3af4bc7d1af85cf01f438dd0c050ea799c5c6c55c8b680d9b9f2c4c10d37a846cefa55ffcdebf3
7
+ data.tar.gz: ba50c3a5b047b1afabd578708fed5ea5cd7cdf875333e31e129752ec83992c6cc8eb0d4e601438846229b273da709e8b7e1a3fd777ad0e0919dde2c7f2349293
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,23 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 1.3.7 (2020-08-11)
4
+ - #599 - Allow metadata access without deserialization attempt (rabotyaga)
5
+ - Sync with ruby-kafka `1.2.0` api
6
+
7
+ ## 1.3.6 (2020-04-24)
8
+ - #583 - Use Karafka.logger for CLI messages (prikha)
9
+ - #582 - Cannot only define seed brokers in consumer groups
10
+
11
+ ## 1.3.5 (2020-04-02)
12
+ - #578 - ThreadError: can't be called from trap context patch
13
+
14
+ ## 1.3.4 (2020-02-17)
15
+ - `dry-configurable` upgrade (solnic)
16
+ - Remove temporary `thor` patches that are no longer needed
17
+
18
+ ## 1.3.3 (2019-12-23)
19
+ - Require `delegate` to fix missing dependency in `ruby-kafka`
20
+
3
21
  ## 1.3.2 (2019-12-23)
4
22
  - #561 - Allow `thor` 1.0.x usage in Karafka
5
23
  - #567 - Ruby 2.7.0 support + unfreeze of a frozen string fix
@@ -68,6 +86,7 @@
68
86
  - #508 - Reset the consumers instances upon reconnecting to a cluster
69
87
  - [#530](https://github.com/karafka/karafka/pull/530) - expose ruby and ruby-kafka version
70
88
  - [534](https://github.com/karafka/karafka/pull/534) - Allow to use headers in the deserializer object
89
+ - [#319](https://github.com/karafka/karafka/pull/328) - Support for exponential backoff in pause
71
90
 
72
91
  ## 1.2.11
73
92
  - [#470](https://github.com/karafka/karafka/issues/470) Karafka not working with dry-configurable 0.8
@@ -106,7 +125,6 @@
106
125
  - #318 - Partition pausing doesn't work with custom topic mappers
107
126
  - Rename ConfigAdapter to ApiAdapter to better reflect what it does
108
127
  - #317 - Manual offset committing doesn't work with custom topic mappers
109
- - #319 - Support for exponential backoff in pause
110
128
 
111
129
  ## 1.2.2
112
130
  - #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,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (1.3.2)
4
+ karafka (1.3.7)
5
5
  dry-configurable (~> 0.8)
6
6
  dry-inflector (~> 0.1)
7
7
  dry-monitor (~> 0.3)
@@ -10,7 +10,7 @@ PATH
10
10
  irb (~> 1.0)
11
11
  multi_json (>= 1.12)
12
12
  rake (>= 11.3)
13
- ruby-kafka (>= 0.7.8)
13
+ ruby-kafka (>= 1.0.0)
14
14
  thor (>= 0.20)
15
15
  waterdrop (~> 1.3.0)
16
16
  zeitwerk (~> 2.1)
@@ -18,23 +18,25 @@ PATH
18
18
  GEM
19
19
  remote: https://rubygems.org/
20
20
  specs:
21
- activesupport (6.0.2.1)
21
+ activesupport (6.0.3.2)
22
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
23
  i18n (>= 0.7, < 2)
24
24
  minitest (~> 5.1)
25
25
  tzinfo (~> 1.1)
26
- zeitwerk (~> 2.2)
27
- byebug (11.0.1)
28
- concurrent-ruby (1.1.5)
29
- delivery_boy (0.2.8)
26
+ zeitwerk (~> 2.2, >= 2.2.2)
27
+ byebug (11.1.3)
28
+ concurrent-ruby (1.1.7)
29
+ delivery_boy (1.0.1)
30
30
  king_konf (~> 0.3)
31
- ruby-kafka (~> 0.7.8)
32
- diff-lcs (1.3)
33
- digest-crc (0.4.1)
31
+ ruby-kafka (~> 1.0)
32
+ diff-lcs (1.4.4)
33
+ digest-crc (0.6.1)
34
+ rake (~> 13.0)
34
35
  docile (1.3.2)
35
- dry-configurable (0.9.0)
36
+ dry-configurable (0.11.6)
36
37
  concurrent-ruby (~> 1.0)
37
38
  dry-core (~> 0.4, >= 0.4.7)
39
+ dry-equalizer (~> 0.2)
38
40
  dry-container (0.7.2)
39
41
  concurrent-ruby (~> 1.0)
40
42
  dry-configurable (~> 0.1, >= 0.1.3)
@@ -46,86 +48,84 @@ GEM
46
48
  dry-core (~> 0.4)
47
49
  dry-equalizer (~> 0.2)
48
50
  dry-inflector (0.2.0)
49
- dry-initializer (3.0.2)
50
- dry-logic (1.0.5)
51
+ dry-initializer (3.0.3)
52
+ dry-logic (1.0.6)
51
53
  concurrent-ruby (~> 1.0)
52
54
  dry-core (~> 0.2)
53
55
  dry-equalizer (~> 0.2)
54
- dry-monitor (0.3.1)
56
+ dry-monitor (0.3.2)
55
57
  dry-configurable (~> 0.5)
56
58
  dry-core (~> 0.4)
57
59
  dry-equalizer (~> 0.2)
58
- dry-events (~> 0.1)
59
- dry-schema (1.4.2)
60
+ dry-events (~> 0.2)
61
+ dry-schema (1.5.2)
60
62
  concurrent-ruby (~> 1.0)
61
63
  dry-configurable (~> 0.8, >= 0.8.3)
62
64
  dry-core (~> 0.4)
63
65
  dry-equalizer (~> 0.2)
64
66
  dry-initializer (~> 3.0)
65
67
  dry-logic (~> 1.0)
66
- dry-types (~> 1.2)
67
- dry-types (1.2.2)
68
+ dry-types (~> 1.4)
69
+ dry-types (1.4.0)
68
70
  concurrent-ruby (~> 1.0)
69
71
  dry-container (~> 0.3)
70
72
  dry-core (~> 0.4, >= 0.4.4)
71
73
  dry-equalizer (~> 0.3)
72
74
  dry-inflector (~> 0.1, >= 0.1.2)
73
75
  dry-logic (~> 1.0, >= 1.0.2)
74
- dry-validation (1.4.0)
76
+ dry-validation (1.5.3)
75
77
  concurrent-ruby (~> 1.0)
76
78
  dry-container (~> 0.7, >= 0.7.1)
77
79
  dry-core (~> 0.4)
78
80
  dry-equalizer (~> 0.2)
79
81
  dry-initializer (~> 3.0)
80
- dry-schema (~> 1.0, >= 1.3.1)
81
- envlogic (1.1.0)
82
+ dry-schema (~> 1.5)
83
+ envlogic (1.1.2)
82
84
  dry-inflector (~> 0.1)
83
- factory_bot (5.1.1)
84
- activesupport (>= 4.2.0)
85
- i18n (1.7.0)
85
+ factory_bot (6.1.0)
86
+ activesupport (>= 5.0.0)
87
+ i18n (1.8.5)
86
88
  concurrent-ruby (~> 1.0)
87
- io-console (0.5.3)
88
- irb (1.2.1)
89
+ io-console (0.5.6)
90
+ irb (1.2.4)
89
91
  reline (>= 0.0.1)
90
- json (2.3.0)
91
92
  king_konf (0.3.7)
92
- minitest (5.13.0)
93
- multi_json (1.14.1)
93
+ minitest (5.14.1)
94
+ multi_json (1.15.0)
94
95
  rake (13.0.1)
95
- reline (0.1.0)
96
+ reline (0.1.4)
96
97
  io-console (~> 0.5)
97
98
  rspec (3.9.0)
98
99
  rspec-core (~> 3.9.0)
99
100
  rspec-expectations (~> 3.9.0)
100
101
  rspec-mocks (~> 3.9.0)
101
- rspec-core (3.9.0)
102
- rspec-support (~> 3.9.0)
103
- rspec-expectations (3.9.0)
102
+ rspec-core (3.9.2)
103
+ rspec-support (~> 3.9.3)
104
+ rspec-expectations (3.9.2)
104
105
  diff-lcs (>= 1.2.0, < 2.0)
105
106
  rspec-support (~> 3.9.0)
106
- rspec-mocks (3.9.0)
107
+ rspec-mocks (3.9.1)
107
108
  diff-lcs (>= 1.2.0, < 2.0)
108
109
  rspec-support (~> 3.9.0)
109
- rspec-support (3.9.0)
110
- ruby-kafka (0.7.10)
110
+ rspec-support (3.9.3)
111
+ ruby-kafka (1.2.0)
111
112
  digest-crc
112
- simplecov (0.17.1)
113
+ simplecov (0.18.5)
113
114
  docile (~> 1.1)
114
- json (>= 1.8, < 3)
115
- simplecov-html (~> 0.10.0)
116
- simplecov-html (0.10.2)
115
+ simplecov-html (~> 0.11)
116
+ simplecov-html (0.12.2)
117
117
  thor (1.0.1)
118
118
  thread_safe (0.3.6)
119
- tzinfo (1.2.5)
119
+ tzinfo (1.2.7)
120
120
  thread_safe (~> 0.1)
121
- waterdrop (1.3.1)
122
- delivery_boy (~> 0.2)
121
+ waterdrop (1.3.4)
122
+ delivery_boy (>= 0.2, < 2.x)
123
123
  dry-configurable (~> 0.8)
124
124
  dry-monitor (~> 0.3)
125
125
  dry-validation (~> 1.2)
126
126
  ruby-kafka (>= 0.7.8)
127
127
  zeitwerk (~> 2.1)
128
- zeitwerk (2.2.2)
128
+ zeitwerk (2.4.0)
129
129
 
130
130
  PLATFORMS
131
131
  ruby
@@ -138,4 +138,4 @@ DEPENDENCIES
138
138
  simplecov
139
139
 
140
140
  BUNDLED WITH
141
- 2.1.2
141
+ 2.1.4
data/README.md CHANGED
@@ -2,11 +2,11 @@
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 Karafka `1.3.x`.
6
6
 
7
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
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).
9
+ If you are looking for the documentation for Karafka `1.2.x`, it can be found [here](https://github.com/karafka/wiki/tree/1.2).
10
10
 
11
11
  ## About Karafka
12
12
 
@@ -98,4 +98,4 @@ This project exists thanks to all the people who contribute.
98
98
 
99
99
  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
100
 
101
- Please contact [Maciej Mensfeld](mailto:maciej@coditsu.io) directly for more details.
101
+ 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
- CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC9fCwtaHZG2SyyNXiH8r0QbJQx/xxl
6
- dkvwWz9QGJO+O8rEx20FB1Ab+MVkfO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4o8/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'
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'irb', '~> 1.0'
26
26
  spec.add_dependency 'multi_json', '>= 1.12'
27
27
  spec.add_dependency 'rake', '>= 11.3'
28
- spec.add_dependency 'ruby-kafka', '>= 0.7.8'
28
+ spec.add_dependency 'ruby-kafka', '>= 1.0.0'
29
29
  spec.add_dependency 'thor', '>= 0.20'
30
30
  spec.add_dependency 'waterdrop', '~> 1.3.0'
31
31
  spec.add_dependency 'zeitwerk', '~> 2.1'
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  %w[
4
+ delegate
4
5
  English
5
6
  waterdrop
6
7
  kafka
@@ -52,14 +52,8 @@ module Karafka
52
52
  ignored_settings = api_adapter[:subscribe]
53
53
  defined_settings = api_adapter.values.flatten
54
54
  karafka_settings = %i[batch_fetching]
55
- # This is a dirty and bad hack of dry-configurable to get keys before setting values
56
- dynamically_proxied = Karafka::Setup::Config
57
- ._settings
58
- .settings
59
- .find { |s| s.name == :kafka }
60
- .value
61
- .names
62
- .to_a
55
+
56
+ dynamically_proxied = Karafka::Setup::Config.config.kafka.to_h.keys
63
57
 
64
58
  (defined_settings + dynamically_proxied).uniq + karafka_settings - ignored_settings
65
59
  end
@@ -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,11 +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 "%-25s %s\n", " - #{label}:", value
43
+ def format(label, value)
44
+ " - #{label}: #{value}"
42
45
  end
43
46
  end
44
47
  end
@@ -24,7 +24,7 @@ module Karafka
24
24
  "Kafka seed brokers: #{config.kafka.seed_brokers}"
25
25
  ]
26
26
 
27
- puts(info.join("\n"))
27
+ Karafka.logger.info(info.join("\n"))
28
28
  end
29
29
  end
30
30
  end
@@ -14,11 +14,12 @@ module Karafka
14
14
  module ApiAdapter
15
15
  class << self
16
16
  # Builds all the configuration settings for Kafka.new method
17
+ # @param consumer_group [Karafka::Routing::ConsumerGroup] consumer group details
17
18
  # @return [Array<Hash>] Array with all the client arguments including hash with all
18
19
  # the settings required by Kafka.new method
19
20
  # @note We return array, so we can inject any arguments we want, in case of changes in the
20
21
  # raw driver
21
- def client
22
+ def client(consumer_group)
22
23
  # This one is a default that takes all the settings except special
23
24
  # cases defined in the map
24
25
  settings = {
@@ -26,14 +27,17 @@ module Karafka
26
27
  client_id: ::Karafka::App.config.client_id
27
28
  }
28
29
 
29
- kafka_configs.each do |setting_name, setting_value|
30
+ kafka_configs.each_key do |setting_name|
30
31
  # All options for config adapter should be ignored as we're just interested
31
32
  # in what is left, as we want to pass all the options that are "typical"
32
33
  # and not listed in the api_adapter special cases mapping. All the values
33
34
  # from the api_adapter mapping go somewhere else, not to the client directly
34
35
  next if AttributesMap.api_adapter.values.flatten.include?(setting_name)
35
36
 
36
- settings[setting_name] = setting_value
37
+ # Settings for each consumer group are either defined per consumer group or are
38
+ # inherited from the global/general settings level, thus we don't have to fetch them
39
+ # from the kafka settings as they are already on a consumer group level
40
+ settings[setting_name] = consumer_group.public_send(setting_name)
37
41
  end
38
42
 
39
43
  settings_hash = sanitize(settings)
@@ -6,9 +6,11 @@ module Karafka
6
6
  module Builder
7
7
  class << self
8
8
  # Builds a Kafka::Client instance that we use to work with Kafka cluster
9
+ # @param consumer_group [Karafka::Routing::ConsumerGroup] consumer group for which we want
10
+ # to have a new Kafka client
9
11
  # @return [::Kafka::Client] returns a Kafka client
10
- def call
11
- Kafka.new(*ApiAdapter.client)
12
+ def call(consumer_group)
13
+ Kafka.new(*ApiAdapter.client(consumer_group))
12
14
  end
13
15
  end
14
16
  end
@@ -97,7 +97,7 @@ module Karafka
97
97
  def kafka_consumer
98
98
  # @note We don't cache the connection internally because we cache kafka_consumer that uses
99
99
  # kafka client object instance
100
- @kafka_consumer ||= Builder.call.consumer(
100
+ @kafka_consumer ||= Builder.call(consumer_group).consumer(
101
101
  *ApiAdapter.consumer(consumer_group)
102
102
  ).tap do |consumer|
103
103
  consumer_group.topics.each do |topic|
@@ -8,7 +8,7 @@ module Karafka
8
8
 
9
9
  # @return [Karafka::Params::Params] params instance for non batch consumption consumers
10
10
  def params
11
- params_batch.first
11
+ params_batch.to_a.first
12
12
  end
13
13
  end
14
14
  end
@@ -6,6 +6,8 @@ module Karafka
6
6
  # We validate some basics + the list of consumer_groups on which we want to use, to make
7
7
  # sure that all of them are defined, plus that a pidfile does not exist
8
8
  class ServerCliOptions < Dry::Validation::Contract
9
+ config.messages.load_paths << File.join(Karafka.gem_root, 'config', 'errors.yml')
10
+
9
11
  params do
10
12
  optional(:pid).filled(:str?)
11
13
  optional(:daemon).filled(:bool?)
@@ -40,6 +40,16 @@ module Karafka
40
40
  end
41
41
  end
42
42
 
43
+ # Overrides `Hash#[]` to allow lazy deserialization of payload. This allows us to fetch
44
+ # metadata without actually triggering deserialization of the payload until it is needed
45
+ # @param key [String, Symbol] hash key
46
+ # @return [Object] content of a given params key
47
+ def [](key)
48
+ # Payload will be deserialized only when we request for it.
49
+ deserialize! if key == 'payload'
50
+ super
51
+ end
52
+
43
53
  # @return [Karafka::Params::Params] This method will trigger deserializer execution. If we
44
54
  # decide to retrieve data, deserializer will be executed to get data. Output of that will
45
55
  # be merged to the current object. This object will be also marked as already deserialized,
@@ -58,9 +58,12 @@ module Karafka
58
58
  def stop_supervised
59
59
  Karafka::App.stop!
60
60
 
61
+ # Temporary patch until https://github.com/dry-rb/dry-configurable/issues/93 is fixed
62
+ timeout = Thread.new { Karafka::App.config.shutdown_timeout }.join.value
63
+
61
64
  # We check from time to time (for the timeout period) if all the threads finished
62
65
  # their work and if so, we can just return and normal shutdown process will take place
63
- (Karafka::App.config.shutdown_timeout * SUPERVISION_CHECK_FACTOR).to_i.times do
66
+ (timeout * SUPERVISION_CHECK_FACTOR).to_i.times do
64
67
  if consumer_threads.count(&:alive?).zero?
65
68
  Thread.new { Karafka.monitor.instrument('app.stopped') }.join
66
69
  return
@@ -124,6 +124,8 @@ module Karafka
124
124
  # will be killed. Note that some Kafka operations are by definition long-running, such as
125
125
  # waiting for new messages to arrive in a partition, so don't set this value too low
126
126
  setting :socket_timeout, 30
127
+ # option partitioner [Object, nil] the partitioner that should be used by the client
128
+ setting :partitioner, nil
127
129
 
128
130
  # SSL authentication related settings
129
131
  # option ca_cert [String, nil] SSL CA certificate
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '1.3.2'
6
+ VERSION = '1.3.7'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -13,30 +13,30 @@ cert_chain:
13
13
  - |
14
14
  -----BEGIN CERTIFICATE-----
15
15
  MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhtYWNp
16
- ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMTkwNzMwMTQ1NDU0WhcNMjAwNzI5MTQ1
17
- NDU0WjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
18
- CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC9fCwtaHZG2SyyNXiH8r0QbJQx/xxl
19
- dkvwWz9QGJO+O8rEx20FB1Ab+MVkfOscwIv5jWpmk1U9whzDPl1uFtIbgu+sk+Zb
20
- uQlZyK/DPN6c+/BbBL+RryTBRyvkPLoCVwm7uxc/JZ1n4AI6eF4cCZ2ieZ9QgQbU
21
- MQs2QPqs9hT50Ez/40GnOdadVfiDDGz+NME2C4ms0BriXwZ1tcRTfJIHe2xjIbbb
22
- y5qRGfsLKcgMzvLQR24olixyX1MR0s4+Wveq3QL/gBhL4veUcv+UABJA8IJR0kyB
23
- seHHutusiwZ1v3SjjjW1xLLrc2ARV0mgCb0WaK2T4iA3oFTGLh6Ydz8LNl31KQFv
24
- 94nRd8IhmJxrhQ6dQ/WT9IXoa5S9lfT5lPJeINemH4/6QPABzf9W2IZlCdI9wCdB
25
- TBaw57MKneGAYZiKjw6OALSy2ltQUCl3RqFl3VP7n8uFy1U987Q5VIIQ3O1UUsQD
26
- Oe/h+r7GUU4RSPKgPlrwvW9bD/UQ+zF51v8CAwEAAaN3MHUwCQYDVR0TBAIwADAL
27
- BgNVHQ8EBAMCBLAwHQYDVR0OBBYEFJNIB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: 2019-12-26 00:00:00.000000000 Z
39
+ date: 2020-08-11 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dry-configurable
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 0.7.8
159
+ version: 1.0.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 0.7.8
166
+ version: 1.0.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: thor
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -208,7 +208,7 @@ dependencies:
208
208
  version: '2.1'
209
209
  description: Framework used to simplify Apache Kafka based Ruby applications development
210
210
  email:
211
- - maciej@coditsu.io
211
+ - maciej@mensfeld.pl
212
212
  - pavlo.vavruk@gmail.com
213
213
  - adam99g@gmail.com
214
214
  executables:
@@ -218,14 +218,15 @@ extra_rdoc_files: []
218
218
  files:
219
219
  - ".coditsu/ci.yml"
220
220
  - ".console_irbrc"
221
+ - ".diffend.yml"
221
222
  - ".github/FUNDING.yml"
222
223
  - ".github/ISSUE_TEMPLATE/bug_report.md"
223
224
  - ".github/ISSUE_TEMPLATE/feature_request.md"
225
+ - ".github/workflows/ci.yml"
224
226
  - ".gitignore"
225
227
  - ".rspec"
226
228
  - ".ruby-gemset"
227
229
  - ".ruby-version"
228
- - ".travis.yml"
229
230
  - CHANGELOG.md
230
231
  - CODE_OF_CONDUCT.md
231
232
  - CONTRIBUTING.md
@@ -236,6 +237,7 @@ files:
236
237
  - bin/karafka
237
238
  - certs/mensfeld.pem
238
239
  - config/errors.yml
240
+ - docker-compose.yml
239
241
  - karafka.gemspec
240
242
  - lib/karafka.rb
241
243
  - lib/karafka/app.rb
@@ -329,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
331
  - !ruby/object:Gem::Version
330
332
  version: '0'
331
333
  requirements: []
332
- rubygems_version: 3.1.0.pre1
334
+ rubygems_version: 3.1.2
333
335
  signing_key:
334
336
  specification_version: 4
335
337
  summary: Ruby based framework for working with Apache Kafka
metadata.gz.sig CHANGED
Binary file
@@ -1,36 +0,0 @@
1
- services:
2
- - docker
3
-
4
- dist: trusty
5
- sudo: false
6
- cache: bundler
7
-
8
- git:
9
- depth: false
10
-
11
- test: &test
12
- stage: Test
13
- language: ruby
14
- before_install:
15
- - yes | gem update --system
16
- script: bundle exec rspec
17
-
18
- jobs:
19
- include:
20
- - <<: *test
21
- rvm: 2.7.0
22
- - <<: *test
23
- rvm: 2.6.5
24
- - <<: *test
25
- rvm: 2.5.7
26
-
27
- - stage: coditsu
28
- language: ruby
29
- rvm: 2.7.0
30
- before_install:
31
- - yes | gem update --system
32
- script: \curl -sSL https://api.coditsu.io/run/ci | bash
33
-
34
- stages:
35
- - test
36
- - coditsu