waterdrop 1.3.1 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) 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 +53 -0
  6. data/.gitignore +4 -0
  7. data/.ruby-version +1 -1
  8. data/CHANGELOG.md +27 -4
  9. data/Gemfile +9 -0
  10. data/Gemfile.lock +54 -37
  11. data/LICENSE +165 -0
  12. data/README.md +192 -53
  13. data/certs/mensfeld.pem +21 -21
  14. data/config/errors.yml +3 -16
  15. data/docker-compose.yml +17 -0
  16. data/lib/water_drop.rb +5 -23
  17. data/lib/water_drop/config.rb +41 -136
  18. data/lib/water_drop/contracts.rb +0 -2
  19. data/lib/water_drop/contracts/config.rb +8 -121
  20. data/lib/water_drop/contracts/message.rb +41 -0
  21. data/lib/water_drop/errors.rb +30 -5
  22. data/lib/water_drop/instrumentation.rb +7 -0
  23. data/lib/water_drop/instrumentation/monitor.rb +16 -23
  24. data/lib/water_drop/instrumentation/stdout_listener.rb +113 -32
  25. data/lib/water_drop/producer.rb +142 -0
  26. data/lib/water_drop/producer/async.rb +51 -0
  27. data/lib/water_drop/producer/buffer.rb +113 -0
  28. data/lib/water_drop/producer/builder.rb +63 -0
  29. data/lib/water_drop/producer/dummy_client.rb +32 -0
  30. data/lib/water_drop/producer/statistics_decorator.rb +71 -0
  31. data/lib/water_drop/producer/status.rb +52 -0
  32. data/lib/water_drop/producer/sync.rb +65 -0
  33. data/lib/water_drop/version.rb +1 -1
  34. data/log/{.keep → .gitkeep} +0 -0
  35. data/waterdrop.gemspec +4 -4
  36. metadata +52 -45
  37. metadata.gz.sig +0 -0
  38. data/.travis.yml +0 -35
  39. data/MIT-LICENCE +0 -18
  40. data/lib/water_drop/async_producer.rb +0 -26
  41. data/lib/water_drop/base_producer.rb +0 -57
  42. data/lib/water_drop/config_applier.rb +0 -52
  43. data/lib/water_drop/contracts/message_options.rb +0 -19
  44. data/lib/water_drop/sync_producer.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc0f332e73321a83f3e2026ee435542e85129149e033381428ea5ed10fb65d4f
4
- data.tar.gz: 1d677bffde0a588a5242568179b84c4a72705a25b6a4720373946b74bbecf411
3
+ metadata.gz: 21d904dd62018fd51b84d19d583c8b9d23e499f7ec348ea77f5652dfd80923ed
4
+ data.tar.gz: 57223b65ddefe69c322b9267b1caec34337f49eece49f5ceeac09030adbf8eee
5
5
  SHA512:
6
- metadata.gz: 9a166e5eafefcda2314eb2348b95d18b364cfb3c05fea120a704e42fa945379c7d59960800c1755ca5e6e92ed084c05d4f5f4589fca04be90446947491d19193
7
- data.tar.gz: f20cf44b891a343616082e41b9d50354102843c95dbe62b9b71e68a7cfec0d1c54a1aaa88540072ecabc937fe7e02f7ad881c4e2f44ef6af55f051390378e5cc
6
+ metadata.gz: b26746357346b68312916f21581830d8b18af6b4233b80f73339ccc55f02e99a7a40d8f7558a64c4fb3325ba2c306a56e8870a5473d5f2e25ed5be08acb5d657
7
+ data.tar.gz: 725b540999dd4e9c05bc33280de6b732f9c601514d2b344160c3932b506b250d8e2082db77ad8f980c2b4d6512e48e70aba9439afb97f60a7db5c8375fcd3ac8
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -0,0 +1,3 @@
1
+ project_id: 'ee590bc9-f375-4832-ac8e-beb174b49aa5'
2
+ shareable_id: '1325b111-b957-4fd8-bd6f-fead41e06034'
3
+ shareable_key: 'd29c6230-8bf6-479b-83ff-98f374d3466e'
@@ -0,0 +1,53 @@
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
+ - 'jruby'
19
+ include:
20
+ - ruby: '2.7'
21
+ coverage: 'true'
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - name: Install package dependencies
25
+ run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{matrix.ruby}}
30
+ - name: Install latest bundler
31
+ run: |
32
+ gem install bundler --no-document
33
+ bundle config set without 'tools benchmarks docs'
34
+ - name: Bundle install
35
+ run: |
36
+ bundle config set without development
37
+ bundle install --jobs 4 --retry 3
38
+ - name: Run Kafka with docker-compose
39
+ run: docker-compose up -d
40
+ - name: Run all tests
41
+ env:
42
+ GITHUB_COVERAGE: ${{matrix.coverage}}
43
+ run: bundle exec rspec
44
+ coditsu:
45
+ runs-on: ubuntu-latest
46
+ strategy:
47
+ fail-fast: false
48
+ steps:
49
+ - uses: actions/checkout@v2
50
+ with:
51
+ fetch-depth: 0
52
+ - name: Run Coditsu
53
+ run: \curl -sSL https://api.coditsu.io/run/ci | bash
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  /vendor/ruby/
5
5
  /ruby/
6
6
  app.god
7
+ example.rb
7
8
 
8
9
  # minimal Rails specific artifacts
9
10
  db/*.sqlite3
@@ -12,6 +13,7 @@ db/*.sqlite3
12
13
  *.gem
13
14
  *.~
14
15
  /.coditsu/local.yml
16
+ .byebug_history
15
17
 
16
18
  # various artifacts
17
19
  **.war
@@ -64,3 +66,5 @@ pickle-email-*.html
64
66
 
65
67
  # documentation
66
68
  .yardoc
69
+
70
+ .byebug_history
@@ -1 +1 @@
1
- 2.6.5
1
+ 2.7.1
@@ -1,5 +1,28 @@
1
1
  # WaterDrop changelog
2
2
 
3
+ ## 2.0.0-rc1 (unreleased)
4
+ - Redesign of the whole API (see `README.md` for the use-cases and the current API)
5
+ - Replace `ruby-kafka` with `rdkafka`
6
+ - Switch license from `MIT` to `LGPL-3.0`
7
+ - #113 - Add some basic validations of the kafka scope of the config (Azdaroth)
8
+ - Global state removed
9
+ - Redesigned metrics that use `rdkafka` internal data + custom diffing
10
+ - Restore JRuby support
11
+
12
+ ## 1.4.0 (2020-08-25)
13
+ - Release to match Karafka 1.4 versioning.
14
+
15
+ ## 1.3.4 (2020-02-17)
16
+ - Support for new `dry-configurable`
17
+
18
+ ## 1.3.3 (2019-01-06)
19
+ - #119 - Support exactly once delivery and transactional messaging (kylekthompson)
20
+ - #119 - Support delivery_boy 1.0 (kylekthompson)
21
+
22
+ ## 1.3.2 (2019-26-12)
23
+ - Ruby 2.7.0 support
24
+ - Fix missing `delegate` dependency on `ruby-kafka`
25
+
3
26
  ## 1.3.1 (2019-10-21)
4
27
  - Ruby 2.6.5 support
5
28
  - Expose setting to optionally verify hostname on ssl certs #109 (tabdollahi)
@@ -27,7 +50,7 @@
27
50
  - Bump delivery_boy (0.2.7 => 0.2.8)
28
51
 
29
52
  ## 1.2.5
30
- - Bump deps to match Karafka
53
+ - Bump dependencies to match Karafka
31
54
  - drop jruby support
32
55
  - drop ruby 2.2 support
33
56
 
@@ -90,7 +113,7 @@
90
113
  - Dev tools update
91
114
  - Gem update
92
115
  - Specs updates
93
- - File namming convention fix from waterdrop to water_drop + compatibility file
116
+ - File naming convention fix from waterdrop to water_drop + compatibility file
94
117
  - Additional params (partition, etc) that can be passed into producer
95
118
 
96
119
  ## 0.3.0
@@ -99,7 +122,7 @@
99
122
  ## 0.2.0
100
123
  - Version dump - this WaterDrop version no longer relies on Aspector to work
101
124
  - #17 - Logger for Aspector - WaterDrop no longer depends on Aspector
102
- - #8 - add send date as a default value added to a message - wontfix. Should be implemented on a message level since WaterDrop just transports messages without adding additional stuff.
125
+ - #8 - add send date as a default value added to a message - wont-fix. Should be implemented on a message level since WaterDrop just transports messages without adding additional stuff.
103
126
  - #11 - same as above
104
127
 
105
128
  ## 0.1.13
@@ -118,7 +141,7 @@
118
141
 
119
142
  ## 0.1.9
120
143
  - Required acks and set to -1 (most secure but slower)
121
- - Added a proxu layer to to producer so we could replate Kafka with other messaging systems
144
+ - Added a proxy layer to to producer so we could replace Kafka with other messaging systems
122
145
  - Gem dump
123
146
 
124
147
  ## 0.1.8
data/Gemfile CHANGED
@@ -2,9 +2,18 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ plugin 'diffend'
6
+
5
7
  gemspec
6
8
 
9
+ gem 'rdkafka'
10
+
11
+ group :development do
12
+ gem 'byebug'
13
+ end
14
+
7
15
  group :test do
16
+ gem 'factory_bot'
8
17
  gem 'rspec'
9
18
  gem 'simplecov'
10
19
  end
@@ -1,101 +1,118 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waterdrop (1.3.1)
5
- delivery_boy (~> 0.2)
4
+ waterdrop (2.0.0.rc1)
5
+ concurrent-ruby (>= 1.1)
6
6
  dry-configurable (~> 0.8)
7
7
  dry-monitor (~> 0.3)
8
- dry-validation (~> 1.2)
9
- ruby-kafka (>= 0.7.8)
8
+ dry-validation (~> 1.3)
9
+ rdkafka (>= 0.6.0)
10
10
  zeitwerk (~> 2.1)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- concurrent-ruby (1.1.5)
16
- delivery_boy (0.2.8)
17
- king_konf (~> 0.3)
18
- ruby-kafka (~> 0.7.8)
19
- diff-lcs (1.3)
20
- digest-crc (0.4.1)
15
+ activesupport (6.0.3.2)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 0.7, < 2)
18
+ minitest (~> 5.1)
19
+ tzinfo (~> 1.1)
20
+ zeitwerk (~> 2.2, >= 2.2.2)
21
+ byebug (11.1.3)
22
+ concurrent-ruby (1.1.7)
23
+ diff-lcs (1.4.4)
21
24
  docile (1.3.2)
22
- dry-configurable (0.8.3)
25
+ dry-configurable (0.11.6)
23
26
  concurrent-ruby (~> 1.0)
24
27
  dry-core (~> 0.4, >= 0.4.7)
28
+ dry-equalizer (~> 0.2)
25
29
  dry-container (0.7.2)
26
30
  concurrent-ruby (~> 1.0)
27
31
  dry-configurable (~> 0.1, >= 0.1.3)
28
32
  dry-core (0.4.9)
29
33
  concurrent-ruby (~> 1.0)
30
- dry-equalizer (0.2.2)
34
+ dry-equalizer (0.3.0)
31
35
  dry-events (0.2.0)
32
36
  concurrent-ruby (~> 1.0)
33
37
  dry-core (~> 0.4)
34
38
  dry-equalizer (~> 0.2)
35
39
  dry-inflector (0.2.0)
36
- dry-initializer (3.0.1)
37
- dry-logic (1.0.3)
40
+ dry-initializer (3.0.3)
41
+ dry-logic (1.0.7)
38
42
  concurrent-ruby (~> 1.0)
39
43
  dry-core (~> 0.2)
40
44
  dry-equalizer (~> 0.2)
41
- dry-monitor (0.3.1)
45
+ dry-monitor (0.3.2)
42
46
  dry-configurable (~> 0.5)
43
47
  dry-core (~> 0.4)
44
48
  dry-equalizer (~> 0.2)
45
- dry-events (~> 0.1)
46
- dry-schema (1.4.1)
49
+ dry-events (~> 0.2)
50
+ dry-schema (1.5.4)
47
51
  concurrent-ruby (~> 1.0)
48
52
  dry-configurable (~> 0.8, >= 0.8.3)
49
53
  dry-core (~> 0.4)
50
54
  dry-equalizer (~> 0.2)
51
55
  dry-initializer (~> 3.0)
52
56
  dry-logic (~> 1.0)
53
- dry-types (~> 1.2)
54
- dry-types (1.2.0)
57
+ dry-types (~> 1.4)
58
+ dry-types (1.4.0)
55
59
  concurrent-ruby (~> 1.0)
56
60
  dry-container (~> 0.3)
57
61
  dry-core (~> 0.4, >= 0.4.4)
58
- dry-equalizer (~> 0.2, >= 0.2.2)
62
+ dry-equalizer (~> 0.3)
59
63
  dry-inflector (~> 0.1, >= 0.1.2)
60
64
  dry-logic (~> 1.0, >= 1.0.2)
61
- dry-validation (1.3.1)
65
+ dry-validation (1.5.5)
62
66
  concurrent-ruby (~> 1.0)
63
67
  dry-container (~> 0.7, >= 0.7.1)
64
68
  dry-core (~> 0.4)
65
69
  dry-equalizer (~> 0.2)
66
70
  dry-initializer (~> 3.0)
67
- dry-schema (~> 1.0, >= 1.3.1)
68
- json (2.2.0)
69
- king_konf (0.3.7)
71
+ dry-schema (~> 1.5)
72
+ factory_bot (6.1.0)
73
+ activesupport (>= 5.0.0)
74
+ ffi (1.13.1)
75
+ i18n (1.8.5)
76
+ concurrent-ruby (~> 1.0)
77
+ mini_portile2 (2.5.0)
78
+ minitest (5.14.2)
79
+ rake (13.0.1)
80
+ rdkafka (0.8.0)
81
+ ffi (~> 1.9)
82
+ mini_portile2 (~> 2.1)
83
+ rake (>= 12.3)
70
84
  rspec (3.9.0)
71
85
  rspec-core (~> 3.9.0)
72
86
  rspec-expectations (~> 3.9.0)
73
87
  rspec-mocks (~> 3.9.0)
74
- rspec-core (3.9.0)
75
- rspec-support (~> 3.9.0)
76
- rspec-expectations (3.9.0)
88
+ rspec-core (3.9.2)
89
+ rspec-support (~> 3.9.3)
90
+ rspec-expectations (3.9.2)
77
91
  diff-lcs (>= 1.2.0, < 2.0)
78
92
  rspec-support (~> 3.9.0)
79
- rspec-mocks (3.9.0)
93
+ rspec-mocks (3.9.1)
80
94
  diff-lcs (>= 1.2.0, < 2.0)
81
95
  rspec-support (~> 3.9.0)
82
- rspec-support (3.9.0)
83
- ruby-kafka (0.7.10)
84
- digest-crc
85
- simplecov (0.17.1)
96
+ rspec-support (3.9.3)
97
+ simplecov (0.19.0)
86
98
  docile (~> 1.1)
87
- json (>= 1.8, < 3)
88
- simplecov-html (~> 0.10.0)
89
- simplecov-html (0.10.2)
90
- zeitwerk (2.2.0)
99
+ simplecov-html (~> 0.11)
100
+ simplecov-html (0.12.2)
101
+ thread_safe (0.3.6)
102
+ tzinfo (1.2.7)
103
+ thread_safe (~> 0.1)
104
+ zeitwerk (2.4.0)
91
105
 
92
106
  PLATFORMS
93
107
  ruby
94
108
 
95
109
  DEPENDENCIES
110
+ byebug
111
+ factory_bot
112
+ rdkafka
96
113
  rspec
97
114
  simplecov
98
115
  waterdrop!
99
116
 
100
117
  BUNDLED WITH
101
- 2.0.2
118
+ 2.1.4
data/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.