karafka 1.2.8 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.coditsu/ci.yml +3 -0
  5. data/.console_irbrc +1 -3
  6. data/.diffend.yml +3 -0
  7. data/.github/FUNDING.yml +3 -0
  8. data/.github/ISSUE_TEMPLATE/bug_report.md +50 -0
  9. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  10. data/.github/workflows/ci.yml +52 -0
  11. data/.gitignore +1 -0
  12. data/.ruby-version +1 -1
  13. data/CHANGELOG.md +134 -14
  14. data/CODE_OF_CONDUCT.md +1 -1
  15. data/CONTRIBUTING.md +1 -1
  16. data/Gemfile +4 -5
  17. data/Gemfile.lock +92 -81
  18. data/README.md +9 -12
  19. data/bin/karafka +1 -1
  20. data/certs/mensfeld.pem +25 -0
  21. data/config/errors.yml +38 -5
  22. data/docker-compose.yml +17 -0
  23. data/karafka.gemspec +18 -17
  24. data/lib/karafka.rb +10 -16
  25. data/lib/karafka/app.rb +14 -6
  26. data/lib/karafka/attributes_map.rb +5 -10
  27. data/lib/karafka/base_consumer.rb +19 -30
  28. data/lib/karafka/base_responder.rb +45 -27
  29. data/lib/karafka/cli.rb +2 -2
  30. data/lib/karafka/cli/console.rb +11 -9
  31. data/lib/karafka/cli/flow.rb +9 -7
  32. data/lib/karafka/cli/info.rb +4 -2
  33. data/lib/karafka/cli/install.rb +30 -6
  34. data/lib/karafka/cli/server.rb +11 -6
  35. data/lib/karafka/code_reloader.rb +67 -0
  36. data/lib/karafka/connection/api_adapter.rb +22 -9
  37. data/lib/karafka/connection/batch_delegator.rb +55 -0
  38. data/lib/karafka/connection/builder.rb +5 -3
  39. data/lib/karafka/connection/client.rb +31 -31
  40. data/lib/karafka/connection/listener.rb +26 -15
  41. data/lib/karafka/connection/message_delegator.rb +36 -0
  42. data/lib/karafka/consumers/batch_metadata.rb +10 -0
  43. data/lib/karafka/consumers/callbacks.rb +32 -15
  44. data/lib/karafka/consumers/includer.rb +31 -18
  45. data/lib/karafka/consumers/responders.rb +2 -2
  46. data/lib/karafka/contracts.rb +10 -0
  47. data/lib/karafka/contracts/config.rb +21 -0
  48. data/lib/karafka/contracts/consumer_group.rb +206 -0
  49. data/lib/karafka/contracts/consumer_group_topic.rb +19 -0
  50. data/lib/karafka/contracts/responder_usage.rb +54 -0
  51. data/lib/karafka/contracts/server_cli_options.rb +31 -0
  52. data/lib/karafka/errors.rb +17 -16
  53. data/lib/karafka/fetcher.rb +28 -30
  54. data/lib/karafka/helpers/class_matcher.rb +12 -2
  55. data/lib/karafka/helpers/config_retriever.rb +1 -1
  56. data/lib/karafka/helpers/inflector.rb +26 -0
  57. data/lib/karafka/helpers/multi_delegator.rb +0 -1
  58. data/lib/karafka/instrumentation/logger.rb +9 -6
  59. data/lib/karafka/instrumentation/monitor.rb +15 -9
  60. data/lib/karafka/instrumentation/proctitle_listener.rb +36 -0
  61. data/lib/karafka/instrumentation/stdout_listener.rb +140 -0
  62. data/lib/karafka/params/batch_metadata.rb +26 -0
  63. data/lib/karafka/params/builders/batch_metadata.rb +30 -0
  64. data/lib/karafka/params/builders/params.rb +38 -0
  65. data/lib/karafka/params/builders/params_batch.rb +25 -0
  66. data/lib/karafka/params/metadata.rb +20 -0
  67. data/lib/karafka/params/params.rb +54 -0
  68. data/lib/karafka/params/params_batch.rb +35 -21
  69. data/lib/karafka/patches/ruby_kafka.rb +21 -8
  70. data/lib/karafka/persistence/client.rb +15 -11
  71. data/lib/karafka/persistence/{consumer.rb → consumers.rb} +20 -13
  72. data/lib/karafka/persistence/topics.rb +48 -0
  73. data/lib/karafka/process.rb +0 -2
  74. data/lib/karafka/responders/builder.rb +1 -1
  75. data/lib/karafka/responders/topic.rb +6 -8
  76. data/lib/karafka/routing/builder.rb +36 -8
  77. data/lib/karafka/routing/consumer_group.rb +1 -1
  78. data/lib/karafka/routing/consumer_mapper.rb +9 -9
  79. data/lib/karafka/routing/proxy.rb +10 -1
  80. data/lib/karafka/routing/topic.rb +5 -3
  81. data/lib/karafka/routing/topic_mapper.rb +16 -18
  82. data/lib/karafka/serialization/json/deserializer.rb +27 -0
  83. data/lib/karafka/serialization/json/serializer.rb +31 -0
  84. data/lib/karafka/server.rb +29 -28
  85. data/lib/karafka/setup/config.rb +67 -37
  86. data/lib/karafka/setup/configurators/water_drop.rb +7 -3
  87. data/lib/karafka/setup/dsl.rb +0 -1
  88. data/lib/karafka/status.rb +7 -3
  89. data/lib/karafka/templates/{application_consumer.rb.example → application_consumer.rb.erb} +2 -1
  90. data/lib/karafka/templates/{application_responder.rb.example → application_responder.rb.erb} +0 -0
  91. data/lib/karafka/templates/karafka.rb.erb +92 -0
  92. data/lib/karafka/version.rb +1 -1
  93. metadata +94 -72
  94. metadata.gz.sig +0 -0
  95. data/.travis.yml +0 -21
  96. data/lib/karafka/callbacks.rb +0 -30
  97. data/lib/karafka/callbacks/config.rb +0 -22
  98. data/lib/karafka/callbacks/dsl.rb +0 -16
  99. data/lib/karafka/connection/delegator.rb +0 -46
  100. data/lib/karafka/instrumentation/listener.rb +0 -112
  101. data/lib/karafka/loader.rb +0 -28
  102. data/lib/karafka/params/dsl.rb +0 -156
  103. data/lib/karafka/parsers/json.rb +0 -38
  104. data/lib/karafka/patches/dry_configurable.rb +0 -35
  105. data/lib/karafka/persistence/topic.rb +0 -29
  106. data/lib/karafka/schemas/config.rb +0 -24
  107. data/lib/karafka/schemas/consumer_group.rb +0 -78
  108. data/lib/karafka/schemas/consumer_group_topic.rb +0 -18
  109. data/lib/karafka/schemas/responder_usage.rb +0 -39
  110. data/lib/karafka/schemas/server_cli_options.rb +0 -43
  111. data/lib/karafka/setup/configurators/base.rb +0 -29
  112. data/lib/karafka/setup/configurators/params.rb +0 -25
  113. data/lib/karafka/templates/karafka.rb.example +0 -54
@@ -1,128 +1,139 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (1.2.8)
5
- activesupport (>= 4.0)
6
- dry-configurable (~> 0.7)
7
- dry-inflector (~> 0.1.1)
8
- dry-monitor (~> 0.1)
9
- dry-validation (~> 0.11)
10
- envlogic (~> 1.0)
11
- multi_json (>= 1.12)
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)
9
+ envlogic (~> 1.1)
10
+ irb (~> 1.0)
12
11
  rake (>= 11.3)
13
- require_all (>= 1.4)
14
- ruby-kafka (>= 0.6)
15
- thor (~> 0.19)
16
- waterdrop (~> 1.2.4)
12
+ ruby-kafka (>= 1.0.0)
13
+ thor (>= 0.20)
14
+ waterdrop (~> 1.4.0)
15
+ zeitwerk (~> 2.1)
17
16
 
18
17
  GEM
19
18
  remote: https://rubygems.org/
20
19
  specs:
21
- activesupport (5.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
- benchmark-ips (2.7.2)
27
- concurrent-ruby (1.0.5)
28
- delivery_boy (0.2.7)
29
- king_konf (~> 0.2)
30
- ruby-kafka (~> 0.5)
31
- diff-lcs (1.3)
32
- digest-crc (0.4.1)
33
- docile (1.3.1)
34
- dry-configurable (0.7.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)
29
+ king_konf (~> 0.3)
30
+ 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)
35
36
  concurrent-ruby (~> 1.0)
36
- dry-container (0.6.0)
37
+ dry-core (~> 0.4, >= 0.4.7)
38
+ dry-equalizer (~> 0.2)
39
+ dry-container (0.7.2)
37
40
  concurrent-ruby (~> 1.0)
38
41
  dry-configurable (~> 0.1, >= 0.1.3)
39
- dry-core (0.4.7)
42
+ dry-core (0.4.9)
40
43
  concurrent-ruby (~> 1.0)
41
- dry-equalizer (0.2.1)
42
- dry-events (0.1.0)
44
+ dry-equalizer (0.3.0)
45
+ dry-events (0.2.0)
43
46
  concurrent-ruby (~> 1.0)
44
47
  dry-core (~> 0.4)
45
48
  dry-equalizer (~> 0.2)
46
- dry-inflector (0.1.2)
47
- dry-logic (0.4.2)
48
- dry-container (~> 0.2, >= 0.2.6)
49
+ dry-inflector (0.2.0)
50
+ dry-initializer (3.0.3)
51
+ dry-logic (1.0.7)
52
+ concurrent-ruby (~> 1.0)
49
53
  dry-core (~> 0.2)
50
54
  dry-equalizer (~> 0.2)
51
- dry-monitor (0.1.2)
55
+ dry-monitor (0.3.2)
52
56
  dry-configurable (~> 0.5)
57
+ dry-core (~> 0.4)
58
+ dry-equalizer (~> 0.2)
59
+ dry-events (~> 0.2)
60
+ dry-schema (1.5.4)
61
+ concurrent-ruby (~> 1.0)
62
+ dry-configurable (~> 0.8, >= 0.8.3)
63
+ dry-core (~> 0.4)
53
64
  dry-equalizer (~> 0.2)
54
- dry-events (~> 0.1)
55
- rouge (~> 2.0, >= 2.2.1)
56
- dry-types (0.13.2)
65
+ dry-initializer (~> 3.0)
66
+ dry-logic (~> 1.0)
67
+ dry-types (~> 1.4)
68
+ dry-types (1.4.0)
57
69
  concurrent-ruby (~> 1.0)
58
70
  dry-container (~> 0.3)
59
71
  dry-core (~> 0.4, >= 0.4.4)
60
- dry-equalizer (~> 0.2)
72
+ dry-equalizer (~> 0.3)
61
73
  dry-inflector (~> 0.1, >= 0.1.2)
62
- dry-logic (~> 0.4, >= 0.4.2)
63
- dry-validation (0.12.2)
74
+ dry-logic (~> 1.0, >= 1.0.2)
75
+ dry-validation (1.5.6)
64
76
  concurrent-ruby (~> 1.0)
65
- dry-configurable (~> 0.1, >= 0.1.3)
66
- dry-core (~> 0.2, >= 0.2.1)
77
+ dry-container (~> 0.7, >= 0.7.1)
78
+ dry-core (~> 0.4)
67
79
  dry-equalizer (~> 0.2)
68
- dry-logic (~> 0.4, >= 0.4.0)
69
- dry-types (~> 0.13.1)
70
- envlogic (1.1.0)
80
+ dry-initializer (~> 3.0)
81
+ dry-schema (~> 1.5, >= 1.5.2)
82
+ envlogic (1.1.2)
71
83
  dry-inflector (~> 0.1)
72
- i18n (1.1.0)
84
+ factory_bot (6.1.0)
85
+ activesupport (>= 5.0.0)
86
+ i18n (1.8.5)
73
87
  concurrent-ruby (~> 1.0)
74
- json (2.1.0)
75
- json (2.1.0-java)
76
- king_konf (0.3.6)
77
- minitest (5.11.3)
78
- multi_json (1.13.1)
79
- null-logger (0.1.5)
80
- rake (12.3.1)
81
- require_all (2.0.0)
82
- rouge (2.2.1)
83
- rspec (3.8.0)
84
- rspec-core (~> 3.8.0)
85
- rspec-expectations (~> 3.8.0)
86
- rspec-mocks (~> 3.8.0)
87
- rspec-core (3.8.0)
88
- rspec-support (~> 3.8.0)
89
- rspec-expectations (3.8.1)
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)
90
103
  diff-lcs (>= 1.2.0, < 2.0)
91
- rspec-support (~> 3.8.0)
92
- rspec-mocks (3.8.0)
104
+ rspec-support (~> 3.9.0)
105
+ rspec-mocks (3.9.1)
93
106
  diff-lcs (>= 1.2.0, < 2.0)
94
- rspec-support (~> 3.8.0)
95
- rspec-support (3.8.0)
96
- ruby-kafka (0.7.2)
107
+ rspec-support (~> 3.9.0)
108
+ rspec-support (3.9.3)
109
+ ruby-kafka (1.2.0)
97
110
  digest-crc
98
- simplecov (0.16.1)
111
+ simplecov (0.19.0)
99
112
  docile (~> 1.1)
100
- json (>= 1.8, < 3)
101
- simplecov-html (~> 0.10.0)
102
- simplecov-html (0.10.2)
103
- thor (0.20.0)
113
+ simplecov-html (~> 0.11)
114
+ simplecov-html (0.12.2)
115
+ thor (1.0.1)
104
116
  thread_safe (0.3.6)
105
- timecop (0.9.1)
106
- tzinfo (1.2.5)
117
+ tzinfo (1.2.7)
107
118
  thread_safe (~> 0.1)
108
- waterdrop (1.2.4)
109
- delivery_boy (~> 0.2)
110
- dry-configurable (~> 0.7)
111
- dry-monitor (~> 0.1)
112
- dry-validation (~> 0.11)
113
- null-logger (~> 0.1)
114
- ruby-kafka (>= 0.6)
119
+ waterdrop (1.4.0)
120
+ 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)
115
127
 
116
128
  PLATFORMS
117
- java
118
129
  ruby
119
130
 
120
131
  DEPENDENCIES
121
- benchmark-ips
132
+ byebug
133
+ factory_bot
122
134
  karafka!
123
135
  rspec
124
136
  simplecov
125
- timecop
126
137
 
127
138
  BUNDLED WITH
128
- 1.16.5
139
+ 2.1.4
data/README.md CHANGED
@@ -2,6 +2,12 @@
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.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).
8
+
9
+ ## About Karafka
10
+
5
11
  Framework used to simplify Apache Kafka based Ruby applications development.
6
12
 
7
13
  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.
@@ -27,15 +33,6 @@ Karafka based applications can be easily deployed to any type of infrastructure,
27
33
  * Docker
28
34
  * Terraform
29
35
 
30
- ## Kafka 0.10 or prior
31
-
32
- If you're using Kafka 0.10, please lock `ruby-kafka` gem in your Gemfile to version `0.6.8`:
33
-
34
- ```ruby
35
- gem 'karafka'
36
- gem 'ruby-kafka', '~> 0.6.8'
37
- ```
38
-
39
36
  ## Support
40
37
 
41
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.
@@ -52,7 +49,7 @@ If you're completely new to the subject, you can start with our "Kafka on Rails"
52
49
  If you want to get started with Kafka and Karafka as fast as possible, then the best idea is to just clone our example repository:
53
50
 
54
51
  ```bash
55
- git clone https://github.com/karafka/karafka-example-app ./example_app
52
+ git clone https://github.com/karafka/example-app ./example_app
56
53
  ```
57
54
 
58
55
  then, just bundle install all the dependencies:
@@ -62,7 +59,7 @@ cd ./example_app
62
59
  bundle install
63
60
  ```
64
61
 
65
- and follow the instructions from the [example app Wiki](https://github.com/karafka/karafka-example-app/blob/master/README.md).
62
+ and follow the instructions from the [example app Wiki](https://github.com/karafka/example-app/blob/master/README.md).
66
63
 
67
64
  **Note**: you need to ensure, that you have Kafka up and running and you need to configure Kafka seed_brokers in the ```karafka.rb``` file.
68
65
 
@@ -99,4 +96,4 @@ This project exists thanks to all the people who contribute.
99
96
 
100
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.
101
98
 
102
- 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.
@@ -10,7 +10,7 @@ else
10
10
  # However when it is unavailable, we still want to be able to run help command
11
11
  # and install command as they don't require configured app itself to run
12
12
  raise(
13
- Karafka::Errors::MissingBootFile,
13
+ Karafka::Errors::MissingBootFileError,
14
14
  Karafka.boot_file
15
15
  ) unless %w[-h install].include?(ARGV[0])
16
16
  end
@@ -0,0 +1,25 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhtYWNp
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
+ EQQWMBSBEm1hY2llakBtZW5zZmVsZC5wbDAdBgNVHRIEFjAUgRJtYWNpZWpAbWVu
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
+ -----END CERTIFICATE-----
@@ -1,6 +1,39 @@
1
1
  en:
2
- errors:
3
- broker_schema?: >
4
- has an invalid format.
5
- Expected schema, host and port number.
6
- Example: kafka://127.0.0.1:9092 or kafka+ssl://127.0.0.1:9092
2
+ dry_validation:
3
+ errors:
4
+ invalid_broker_schema: >
5
+ has an invalid format
6
+ Expected schema, host and port number
7
+ Example: kafka://127.0.0.1:9092 or kafka+ssl://127.0.0.1:9092
8
+ invalid_certificate: >
9
+ is not a valid certificate
10
+ invalid_certificate_from_path: >
11
+ is not a valid certificate
12
+ invalid_private_key: >
13
+ is not a valid private key
14
+ max_timeout_size_for_exponential: >
15
+ pause_timeout cannot be more than pause_max_timeout
16
+ max_wait_time_limit:
17
+ max_wait_time cannot be more than socket_timeout
18
+ topics_names_not_unique: >
19
+ all topic names within a single consumer group must be unique
20
+ ssl_client_cert_with_ssl_client_cert_key: >
21
+ Both ssl_client_cert and ssl_client_cert_key need to be provided
22
+ ssl_client_cert_key_with_ssl_client_cert: >
23
+ Both ssl_client_cert_key and ssl_client_cert need to be provided
24
+ ssl_client_cert_chain_with_ssl_client_cert: >
25
+ Both ssl_client_cert_chain and ssl_client_cert need to be provided
26
+ ssl_client_cert_chain_with_ssl_client_cert_key: >
27
+ Both ssl_client_cert_chain and ssl_client_cert_key need to be provided
28
+ ssl_client_cert_key_password_with_ssl_client_cert_key: >
29
+ Both ssl_client_cert_key_password and ssl_client_cert_key need to be provided
30
+ does_not_respond_to_token: >
31
+ needs to respond to a #token method
32
+ required_usage_count: >
33
+ Given topic must be used at least once
34
+ pid_already_exists: >
35
+ Pidfile already exists
36
+ consumer_groups_inclusion: >
37
+ Unknown consumer group
38
+ does_not_exist:
39
+ Given file does not exist or cannot be read
@@ -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
@@ -5,38 +5,39 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  require 'karafka/version'
7
7
 
8
+ # rubocop:disable Metrics/BlockLength
8
9
  Gem::Specification.new do |spec|
9
10
  spec.name = 'karafka'
10
11
  spec.version = ::Karafka::VERSION
11
12
  spec.platform = Gem::Platform::RUBY
12
13
  spec.authors = ['Maciej Mensfeld', 'Pavlo Vavruk', 'Adam Gwozdowski']
13
- 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]
14
15
  spec.homepage = 'https://github.com/karafka/karafka'
15
16
  spec.summary = 'Ruby based framework for working with Apache Kafka'
16
17
  spec.description = 'Framework used to simplify Apache Kafka based Ruby applications development'
17
18
  spec.license = 'MIT'
18
19
 
19
- spec.add_dependency 'activesupport', '>= 4.0'
20
- spec.add_dependency 'dry-configurable', '~> 0.7'
21
- spec.add_dependency 'dry-inflector', '~> 0.1.1'
22
- spec.add_dependency 'dry-monitor', '~> 0.1'
23
- spec.add_dependency 'dry-validation', '~> 0.11'
24
- spec.add_dependency 'envlogic', '~> 1.0'
25
- spec.add_dependency 'multi_json', '>= 1.12'
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'
24
+ spec.add_dependency 'envlogic', '~> 1.1'
25
+ spec.add_dependency 'irb', '~> 1.0'
26
26
  spec.add_dependency 'rake', '>= 11.3'
27
- spec.add_dependency 'require_all', '>= 1.4'
28
- spec.add_dependency 'ruby-kafka', '>= 0.6'
29
- spec.add_dependency 'thor', '~> 0.19'
30
- spec.add_dependency 'waterdrop', '~> 1.2.4'
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'
31
31
 
32
- spec.post_install_message = <<~MSG
33
- \e[93mWarning:\e[0m If you're using Kafka 0.10, please lock ruby-kafka in your Gemfile to version '0.6.8':
34
- gem 'ruby-kafka', '~> 0.6.8'
35
- MSG
32
+ spec.required_ruby_version = '>= 2.5.0'
36
33
 
37
- spec.required_ruby_version = '>= 2.3.0'
34
+ if $PROGRAM_NAME.end_with?('gem')
35
+ spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
36
+ end
38
37
 
38
+ spec.cert_chain = %w[certs/mensfeld.pem]
39
39
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
40
40
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
41
41
  spec.require_paths = %w[lib]
42
42
  end
43
+ # rubocop:enable Metrics/BlockLength
@@ -1,20 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  %w[
4
+ delegate
4
5
  English
5
6
  waterdrop
6
7
  kafka
7
8
  envlogic
9
+ json
8
10
  thor
11
+ forwardable
9
12
  fileutils
10
- multi_json
11
- require_all
12
13
  dry-configurable
13
14
  dry-validation
15
+ dry/events/publisher
14
16
  dry/inflector
15
17
  dry/monitor/notifications
16
- active_support/callbacks
17
- karafka/loader
18
+ dry/core/constants
19
+ zeitwerk
18
20
  ].each(&method(:require))
19
21
 
20
22
  # Karafka library
@@ -62,17 +64,9 @@ module Karafka
62
64
  end
63
65
  end
64
66
 
65
- %w[
66
- callbacks
67
- callbacks/*
68
- setup/dsl
69
- setup/config
70
- status
71
- schemas/config
72
- schemas/consumer_group_topic
73
- schemas/consumer_group
74
- ].each { |path| require_all File.join(Karafka.core_root, path + '.rb') }
67
+ Zeitwerk::Loader
68
+ .for_gem
69
+ .tap(&:setup)
70
+ .tap(&:eager_load)
75
71
 
76
- Karafka::Loader.load!(Karafka.core_root)
77
72
  Kafka::Consumer.prepend(Karafka::Patches::RubyKafka)
78
- Dry::Configurable::Config.prepend(Karafka::Patches::DryConfigurable)