waterdrop 2.0.0 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +31 -5
- data/.ruby-version +1 -1
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +46 -55
- data/MIT-LICENSE +18 -0
- data/README.md +76 -30
- data/certs/mensfeld.pem +21 -21
- data/docker-compose.yml +2 -1
- data/lib/water_drop/config.rb +20 -8
- data/lib/water_drop/contracts/message.rb +1 -0
- data/lib/water_drop/producer.rb +10 -7
- data/lib/water_drop/version.rb +1 -1
- data/waterdrop.gemspec +7 -7
- data.tar.gz.sig +0 -0
- metadata +37 -38
- metadata.gz.sig +0 -0
- data/.github/FUNDING.yml +0 -1
- data/LICENSE +0 -165
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85bb80807690f36f2dff0e6da8e4382b1b03e00e34464cd9ba17fc3ca476e69a
|
4
|
+
data.tar.gz: 636af3b96412184c7ae744805a941d13008ede5e4e86323c0f6117d0bdf6747b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f67e059760f6019a455f0ffad0dcef24080e638ff5c34bafbc3cb56cec614457c2aa991e8c964685cc55bb93e8bce7c5e0e25745cd743e0ed060ea5b275d118b
|
7
|
+
data.tar.gz: 5451c3dcba29bf66c4a30630733d8b8dfbf9d05935cba1414c61dd0834907f116a6ebadd8fe5df571423abe09ae687cee8aaad5acbcdf2b3eecfe595a95d4ff2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
name: ci
|
2
2
|
|
3
3
|
on:
|
4
|
+
pull_request:
|
4
5
|
push:
|
5
6
|
schedule:
|
6
7
|
- cron: '0 1 * * *'
|
@@ -8,16 +9,17 @@ on:
|
|
8
9
|
jobs:
|
9
10
|
specs:
|
10
11
|
runs-on: ubuntu-latest
|
12
|
+
needs: diffend
|
11
13
|
strategy:
|
12
14
|
fail-fast: false
|
13
15
|
matrix:
|
14
16
|
ruby:
|
17
|
+
- '3.0'
|
15
18
|
- '2.7'
|
16
19
|
- '2.6'
|
17
|
-
- '
|
18
|
-
- 'jruby'
|
20
|
+
- 'jruby-head'
|
19
21
|
include:
|
20
|
-
- ruby: '
|
22
|
+
- ruby: '3.0'
|
21
23
|
coverage: 'true'
|
22
24
|
steps:
|
23
25
|
- uses: actions/checkout@v2
|
@@ -27,6 +29,12 @@ jobs:
|
|
27
29
|
uses: ruby/setup-ruby@v1
|
28
30
|
with:
|
29
31
|
ruby-version: ${{matrix.ruby}}
|
32
|
+
- name: Run Kafka with docker-compose
|
33
|
+
# We need to give Kafka enough time to start and create all the needed topics, etc
|
34
|
+
# If anyone has a better idea on how to do it smart and easily, please contact me
|
35
|
+
run: |
|
36
|
+
docker-compose up -d
|
37
|
+
sleep 5
|
30
38
|
- name: Install latest bundler
|
31
39
|
run: |
|
32
40
|
gem install bundler --no-document
|
@@ -35,12 +43,30 @@ jobs:
|
|
35
43
|
run: |
|
36
44
|
bundle config set without development
|
37
45
|
bundle install --jobs 4 --retry 3
|
38
|
-
- name: Run Kafka with docker-compose
|
39
|
-
run: docker-compose up -d
|
40
46
|
- name: Run all tests
|
41
47
|
env:
|
42
48
|
GITHUB_COVERAGE: ${{matrix.coverage}}
|
43
49
|
run: bundle exec rspec
|
50
|
+
|
51
|
+
diffend:
|
52
|
+
runs-on: ubuntu-latest
|
53
|
+
strategy:
|
54
|
+
fail-fast: false
|
55
|
+
steps:
|
56
|
+
- uses: actions/checkout@v2
|
57
|
+
with:
|
58
|
+
fetch-depth: 0
|
59
|
+
- name: Set up Ruby
|
60
|
+
uses: ruby/setup-ruby@v1
|
61
|
+
with:
|
62
|
+
ruby-version: 3.0
|
63
|
+
- name: Install latest bundler
|
64
|
+
run: gem install bundler --no-document
|
65
|
+
- name: Install Diffend plugin
|
66
|
+
run: bundle plugin install diffend
|
67
|
+
- name: Bundle Secure
|
68
|
+
run: bundle secure
|
69
|
+
|
44
70
|
coditsu:
|
45
71
|
runs-on: ubuntu-latest
|
46
72
|
strategy:
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# WaterDrop changelog
|
2
2
|
|
3
|
+
## 2.0.4 (Unreleased)
|
4
|
+
- Update `dry-*` to the recent versions and update settings syntax to match it
|
5
|
+
- Update Zeitwerk requirement
|
6
|
+
|
7
|
+
## 2.0.3 (2021-09-05)
|
8
|
+
- Remove rdkafka patch in favour of spec topic pre-creation
|
9
|
+
- Do not close client that was never used upon closing producer
|
10
|
+
|
11
|
+
## 2.0.2 (2021-08-13)
|
12
|
+
- Add support for `partition_key`
|
13
|
+
- Switch license from `LGPL-3.0` to `MIT`
|
14
|
+
- Switch flushing on close to sync
|
15
|
+
|
16
|
+
## 2.0.1 (2021-06-05)
|
17
|
+
- Remove Ruby 2.5 support and update minimum Ruby requirement to 2.6
|
18
|
+
- Fix the `finalizer references object to be finalized` warning issued with 3.0
|
19
|
+
|
3
20
|
## 2.0.0 (2020-12-13)
|
4
21
|
- Redesign of the whole API (see `README.md` for the use-cases and the current API)
|
5
22
|
- Replace `ruby-kafka` with `rdkafka`
|
data/Gemfile.lock
CHANGED
@@ -1,83 +1,75 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
waterdrop (2.0.
|
4
|
+
waterdrop (2.0.4)
|
5
5
|
concurrent-ruby (>= 1.1)
|
6
|
-
dry-configurable (~> 0.
|
7
|
-
dry-monitor (~> 0.
|
8
|
-
dry-validation (~> 1.
|
9
|
-
rdkafka (>= 0.
|
10
|
-
zeitwerk (~> 2.
|
6
|
+
dry-configurable (~> 0.13)
|
7
|
+
dry-monitor (~> 0.5)
|
8
|
+
dry-validation (~> 1.7)
|
9
|
+
rdkafka (>= 0.10)
|
10
|
+
zeitwerk (~> 2.3)
|
11
11
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (6.1.
|
15
|
+
activesupport (6.1.4.1)
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
17
|
i18n (>= 1.6, < 2)
|
18
18
|
minitest (>= 5.1)
|
19
19
|
tzinfo (~> 2.0)
|
20
20
|
zeitwerk (~> 2.3)
|
21
21
|
byebug (11.1.3)
|
22
|
-
concurrent-ruby (1.1.
|
22
|
+
concurrent-ruby (1.1.9)
|
23
23
|
diff-lcs (1.4.4)
|
24
|
-
docile (1.
|
25
|
-
dry-configurable (0.
|
24
|
+
docile (1.4.0)
|
25
|
+
dry-configurable (0.13.0)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
|
-
dry-core (~> 0.
|
28
|
-
|
29
|
-
dry-container (0.7.2)
|
27
|
+
dry-core (~> 0.6)
|
28
|
+
dry-container (0.9.0)
|
30
29
|
concurrent-ruby (~> 1.0)
|
31
|
-
dry-configurable (~> 0.
|
32
|
-
dry-core (0.
|
30
|
+
dry-configurable (~> 0.13, >= 0.13.0)
|
31
|
+
dry-core (0.7.1)
|
33
32
|
concurrent-ruby (~> 1.0)
|
34
|
-
dry-
|
35
|
-
dry-events (0.2.0)
|
33
|
+
dry-events (0.3.0)
|
36
34
|
concurrent-ruby (~> 1.0)
|
37
|
-
dry-core (~> 0.
|
38
|
-
|
39
|
-
dry-inflector (0.2.0)
|
35
|
+
dry-core (~> 0.5, >= 0.5)
|
36
|
+
dry-inflector (0.2.1)
|
40
37
|
dry-initializer (3.0.4)
|
41
|
-
dry-logic (1.0
|
38
|
+
dry-logic (1.2.0)
|
42
39
|
concurrent-ruby (~> 1.0)
|
43
|
-
dry-core (~> 0.
|
44
|
-
|
45
|
-
|
46
|
-
dry-
|
47
|
-
dry-core (~> 0.4)
|
48
|
-
dry-equalizer (~> 0.2)
|
40
|
+
dry-core (~> 0.5, >= 0.5)
|
41
|
+
dry-monitor (0.5.0)
|
42
|
+
dry-configurable (~> 0.13, >= 0.13.0)
|
43
|
+
dry-core (~> 0.5, >= 0.5)
|
49
44
|
dry-events (~> 0.2)
|
50
|
-
dry-schema (1.
|
45
|
+
dry-schema (1.8.0)
|
51
46
|
concurrent-ruby (~> 1.0)
|
52
|
-
dry-configurable (~> 0.
|
53
|
-
dry-core (~> 0.
|
54
|
-
dry-equalizer (~> 0.2)
|
47
|
+
dry-configurable (~> 0.13, >= 0.13.0)
|
48
|
+
dry-core (~> 0.5, >= 0.5)
|
55
49
|
dry-initializer (~> 3.0)
|
56
50
|
dry-logic (~> 1.0)
|
57
|
-
dry-types (~> 1.
|
58
|
-
dry-types (1.
|
51
|
+
dry-types (~> 1.5)
|
52
|
+
dry-types (1.5.1)
|
59
53
|
concurrent-ruby (~> 1.0)
|
60
54
|
dry-container (~> 0.3)
|
61
|
-
dry-core (~> 0.
|
62
|
-
dry-equalizer (~> 0.3)
|
55
|
+
dry-core (~> 0.5, >= 0.5)
|
63
56
|
dry-inflector (~> 0.1, >= 0.1.2)
|
64
57
|
dry-logic (~> 1.0, >= 1.0.2)
|
65
|
-
dry-validation (1.
|
58
|
+
dry-validation (1.7.0)
|
66
59
|
concurrent-ruby (~> 1.0)
|
67
60
|
dry-container (~> 0.7, >= 0.7.1)
|
68
|
-
dry-core (~> 0.
|
69
|
-
dry-equalizer (~> 0.2)
|
61
|
+
dry-core (~> 0.5, >= 0.5)
|
70
62
|
dry-initializer (~> 3.0)
|
71
|
-
dry-schema (~> 1.
|
72
|
-
factory_bot (6.
|
63
|
+
dry-schema (~> 1.8, >= 1.8.0)
|
64
|
+
factory_bot (6.2.0)
|
73
65
|
activesupport (>= 5.0.0)
|
74
|
-
ffi (1.
|
75
|
-
i18n (1.8.
|
66
|
+
ffi (1.15.4)
|
67
|
+
i18n (1.8.10)
|
76
68
|
concurrent-ruby (~> 1.0)
|
77
|
-
mini_portile2 (2.
|
78
|
-
minitest (5.14.
|
79
|
-
rake (13.0.
|
80
|
-
rdkafka (0.
|
69
|
+
mini_portile2 (2.7.0)
|
70
|
+
minitest (5.14.4)
|
71
|
+
rake (13.0.6)
|
72
|
+
rdkafka (0.10.0)
|
81
73
|
ffi (~> 1.9)
|
82
74
|
mini_portile2 (~> 2.1)
|
83
75
|
rake (>= 12.3)
|
@@ -85,27 +77,26 @@ GEM
|
|
85
77
|
rspec-core (~> 3.10.0)
|
86
78
|
rspec-expectations (~> 3.10.0)
|
87
79
|
rspec-mocks (~> 3.10.0)
|
88
|
-
rspec-core (3.10.
|
80
|
+
rspec-core (3.10.1)
|
89
81
|
rspec-support (~> 3.10.0)
|
90
|
-
rspec-expectations (3.10.
|
82
|
+
rspec-expectations (3.10.1)
|
91
83
|
diff-lcs (>= 1.2.0, < 2.0)
|
92
84
|
rspec-support (~> 3.10.0)
|
93
|
-
rspec-mocks (3.10.
|
85
|
+
rspec-mocks (3.10.2)
|
94
86
|
diff-lcs (>= 1.2.0, < 2.0)
|
95
87
|
rspec-support (~> 3.10.0)
|
96
|
-
rspec-support (3.10.
|
97
|
-
simplecov (0.
|
88
|
+
rspec-support (3.10.2)
|
89
|
+
simplecov (0.21.2)
|
98
90
|
docile (~> 1.1)
|
99
91
|
simplecov-html (~> 0.11)
|
100
92
|
simplecov_json_formatter (~> 0.1)
|
101
93
|
simplecov-html (0.12.3)
|
102
|
-
simplecov_json_formatter (0.1.
|
103
|
-
tzinfo (2.0.
|
94
|
+
simplecov_json_formatter (0.1.3)
|
95
|
+
tzinfo (2.0.4)
|
104
96
|
concurrent-ruby (~> 1.0)
|
105
97
|
zeitwerk (2.4.2)
|
106
98
|
|
107
99
|
PLATFORMS
|
108
|
-
ruby
|
109
100
|
x86_64-linux
|
110
101
|
|
111
102
|
DEPENDENCIES
|
@@ -117,4 +108,4 @@ DEPENDENCIES
|
|
117
108
|
waterdrop!
|
118
109
|
|
119
110
|
BUNDLED WITH
|
120
|
-
2.2.
|
111
|
+
2.2.27
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
2
|
+
a copy of this software and associated documentation files (the
|
3
|
+
"Software"), to deal in the Software without restriction, including
|
4
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
5
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
6
|
+
permit persons to whom the Software is furnished to do so, subject to
|
7
|
+
the following conditions:
|
8
|
+
|
9
|
+
The above copyright notice and this permission notice shall be
|
10
|
+
included in all copies or substantial portions of the Software.
|
11
|
+
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
13
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
14
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
15
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
16
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
17
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
18
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# WaterDrop
|
2
2
|
|
3
|
-
**Note**: Documentation presented here refers to WaterDrop `2.0.0
|
3
|
+
**Note**: Documentation presented here refers to WaterDrop `2.0.0`.
|
4
4
|
|
5
5
|
WaterDrop `2.0` does **not** work with Karafka `1.*` and aims to either work as a standalone producer outside of Karafka `1.*` ecosystem or as a part of not yet released Karafka `2.0.*`.
|
6
6
|
|
7
|
-
Please refer to [this](https://github.com/karafka/waterdrop/tree/1.4) branch and
|
7
|
+
Please refer to [this](https://github.com/karafka/waterdrop/tree/1.4) branch and its documentation for details about WaterDrop `1.*` usage.
|
8
8
|
|
9
9
|
[![Build Status](https://github.com/karafka/waterdrop/workflows/ci/badge.svg)](https://github.com/karafka/waterdrop/actions?query=workflow%3Aci)
|
10
|
-
[![
|
10
|
+
[![Gem Version](https://badge.fury.io/rb/waterdrop.svg)](http://badge.fury.io/rb/waterdrop)
|
11
|
+
[![Join the chat at https://slack.karafka.io](https://raw.githubusercontent.com/karafka/misc/master/slack.svg)](https://slack.karafka.io)
|
11
12
|
|
12
13
|
Gem used to send messages to Kafka in an easy way with an extra validation layer. It is a part of the [Karafka](https://github.com/karafka/karafka) ecosystem.
|
13
14
|
|
@@ -19,7 +20,26 @@ It:
|
|
19
20
|
- Supports buffering
|
20
21
|
- Supports producing messages to multiple clusters
|
21
22
|
- Supports multiple delivery policies
|
22
|
-
- Works with Kafka 1.0+ and Ruby 2.
|
23
|
+
- Works with Kafka 1.0+ and Ruby 2.6+
|
24
|
+
|
25
|
+
## Table of contents
|
26
|
+
|
27
|
+
- [WaterDrop](#waterdrop)
|
28
|
+
* [Table of contents](#table-of-contents)
|
29
|
+
* [Installation](#installation)
|
30
|
+
* [Setup](#setup)
|
31
|
+
+ [WaterDrop configuration options](#waterdrop-configuration-options)
|
32
|
+
+ [Kafka configuration options](#kafka-configuration-options)
|
33
|
+
* [Usage](#usage)
|
34
|
+
+ [Basic usage](#basic-usage)
|
35
|
+
+ [Buffering](#buffering)
|
36
|
+
- [Using WaterDrop to buffer messages based on the application logic](#using-waterdrop-to-buffer-messages-based-on-the-application-logic)
|
37
|
+
- [Using WaterDrop with rdkafka buffers to achieve periodic auto-flushing](#using-waterdrop-with-rdkafka-buffers-to-achieve-periodic-auto-flushing)
|
38
|
+
* [Instrumentation](#instrumentation)
|
39
|
+
+ [Usage statistics](#usage-statistics)
|
40
|
+
+ [Forking and potential memory problems](#forking-and-potential-memory-problems)
|
41
|
+
* [References](#references)
|
42
|
+
* [Note on contributions](#note-on-contributions)
|
23
43
|
|
24
44
|
## Installation
|
25
45
|
|
@@ -43,8 +63,8 @@ bundle install
|
|
43
63
|
|
44
64
|
WaterDrop is a complex tool, that contains multiple configuration options. To keep everything organized, all the configuration options were divided into two groups:
|
45
65
|
|
46
|
-
- WaterDrop options - options directly related to
|
47
|
-
- Kafka driver options - options related to `
|
66
|
+
- WaterDrop options - options directly related to WaterDrop and its components
|
67
|
+
- Kafka driver options - options related to `rdkafka`
|
48
68
|
|
49
69
|
To apply all those configuration options, you need to create a producer instance and use the ```#setup``` method:
|
50
70
|
|
@@ -88,7 +108,7 @@ You can create producers with different `kafka` settings. Documentation of the a
|
|
88
108
|
|
89
109
|
## Usage
|
90
110
|
|
91
|
-
Please refer to the [documentation](https://www.rubydoc.info/
|
111
|
+
Please refer to the [documentation](https://www.rubydoc.info/gems/waterdrop) in case you're interested in the more advanced API.
|
92
112
|
|
93
113
|
### Basic usage
|
94
114
|
|
@@ -130,20 +150,25 @@ Each message that you want to publish, will have its value checked.
|
|
130
150
|
|
131
151
|
Here are all the things you can provide in the message hash:
|
132
152
|
|
133
|
-
| Option
|
134
|
-
|
135
|
-
| `topic`
|
136
|
-
| `payload`
|
137
|
-
| `key`
|
138
|
-
| `partition`
|
139
|
-
| `
|
140
|
-
| `
|
153
|
+
| Option | Required | Value type | Description |
|
154
|
+
|-----------------|----------|---------------|----------------------------------------------------------|
|
155
|
+
| `topic` | true | String | The Kafka topic that should be written to |
|
156
|
+
| `payload` | true | String | Data you want to send to Kafka |
|
157
|
+
| `key` | false | String | The key that should be set in the Kafka message |
|
158
|
+
| `partition` | false | Integer | A specific partition number that should be written to |
|
159
|
+
| `partition_key` | false | String | Key to indicate the destination partition of the message |
|
160
|
+
| `timestamp` | false | Time, Integer | The timestamp that should be set on the message |
|
161
|
+
| `headers` | false | Hash | Headers for the message |
|
141
162
|
|
142
163
|
Keep in mind, that message you want to send should be either binary or stringified (to_s, to_json, etc).
|
143
164
|
|
144
165
|
### Buffering
|
145
166
|
|
146
|
-
WaterDrop producers support buffering
|
167
|
+
WaterDrop producers support buffering messages in their internal buffers and on the `rdkafka` level via `queue.buffering.*` set of settings.
|
168
|
+
|
169
|
+
This means that depending on your use case, you can achieve both granular buffering and flushing control when needed with context awareness and periodic and size-based flushing functionalities.
|
170
|
+
|
171
|
+
#### Using WaterDrop to buffer messages based on the application logic
|
147
172
|
|
148
173
|
```ruby
|
149
174
|
producer = WaterDrop::Producer.new
|
@@ -152,16 +177,41 @@ producer.setup do |config|
|
|
152
177
|
config.kafka = { 'bootstrap.servers': 'localhost:9092' }
|
153
178
|
end
|
154
179
|
|
155
|
-
|
180
|
+
# Simulating some events states of a transaction - notice, that the messages will be flushed to
|
181
|
+
# kafka only upon arrival of the `finished` state.
|
182
|
+
%w[
|
183
|
+
started
|
184
|
+
processed
|
185
|
+
finished
|
186
|
+
].each do |state|
|
187
|
+
producer.buffer(topic: 'events', payload: state)
|
188
|
+
|
189
|
+
puts "The messages buffer size #{producer.messages.size}"
|
190
|
+
producer.flush_sync if state == 'finished'
|
191
|
+
puts "The messages buffer size #{producer.messages.size}"
|
192
|
+
end
|
156
193
|
|
157
|
-
|
158
|
-
|
159
|
-
|
194
|
+
producer.close
|
195
|
+
```
|
196
|
+
|
197
|
+
#### Using WaterDrop with rdkafka buffers to achieve periodic auto-flushing
|
198
|
+
|
199
|
+
```ruby
|
200
|
+
producer = WaterDrop::Producer.new
|
201
|
+
|
202
|
+
producer.setup do |config|
|
203
|
+
config.kafka = {
|
204
|
+
'bootstrap.servers': 'localhost:9092',
|
205
|
+
# Accumulate messages for at most 10 seconds
|
206
|
+
'queue.buffering.max.ms' => 10_000
|
207
|
+
}
|
160
208
|
end
|
161
209
|
|
162
|
-
|
163
|
-
|
164
|
-
|
210
|
+
# WaterDrop will flush messages minimum once every 10 seconds
|
211
|
+
30.times do |i|
|
212
|
+
producer.produce_async(topic: 'events', payload: i.to_s)
|
213
|
+
sleep(1)
|
214
|
+
end
|
165
215
|
|
166
216
|
producer.close
|
167
217
|
```
|
@@ -255,12 +305,8 @@ To tackle this [obstacle](https://github.com/appsignal/rdkafka-ruby/issues/15) r
|
|
255
305
|
|
256
306
|
## Note on contributions
|
257
307
|
|
258
|
-
First, thank you for considering contributing to
|
259
|
-
|
260
|
-
Each pull request must pass all the RSpec specs and meet our quality requirements.
|
261
|
-
|
262
|
-
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.
|
308
|
+
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!
|
263
309
|
|
264
|
-
|
310
|
+
Each pull request must pass all the RSpec specs, integration tests and meet our quality requirements.
|
265
311
|
|
266
|
-
|
312
|
+
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMjEwODExMTQxNTEzWhcNMjIwODExMTQx
|
4
|
+
NTEzWjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
|
5
|
+
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDV2jKH4Ti87GM6nyT6D+ESzTI0MZDj
|
6
|
+
ak2/TEwnxvijMJyCCPKT/qIkbW4/f0VHM4rhPr1nW73sb5SZBVFCLlJcOSKOBdUY
|
7
|
+
TMY+SIXN2EtUaZuhAOe8LxtxjHTgRHvHcqUQMBENXTISNzCo32LnUxweu66ia4Pd
|
8
|
+
1mNRhzOqNv9YiBZvtBf7IMQ+sYdOCjboq2dlsWmJiwiDpY9lQBTnWORnT3mQxU5x
|
9
|
+
vPSwnLB854cHdCS8fQo4DjeJBRZHhEbcE5sqhEMB3RZA3EtFVEXOxlNxVTS3tncI
|
10
|
+
qyNXiWDaxcipaens4ObSY1C2HTV7OWb7OMqSCIybeYTSfkaSdqmcl4S6zxXkjH1J
|
11
|
+
tnjayAVzD+QVXGijsPLE2PFnJAh9iDET2cMsjabO1f6l1OQNyAtqpcyQcgfnyW0z
|
12
|
+
g7tGxTYD+6wJHffM9d9txOUw6djkF6bDxyqB8lo4Z3IObCx18AZjI9XPS9QG7w6q
|
13
|
+
LCWuMG2lkCcRgASqaVk9fEf9yMc2xxz5o3kCAwEAAaN3MHUwCQYDVR0TBAIwADAL
|
14
|
+
BgNVHQ8EBAMCBLAwHQYDVR0OBBYEFBqUFCKCOe5IuueUVqOB991jyCLLMB0GA1Ud
|
15
15
|
EQQWMBSBEm1hY2llakBtZW5zZmVsZC5wbDAdBgNVHRIEFjAUgRJtYWNpZWpAbWVu
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
c2ZlbGQucGwwDQYJKoZIhvcNAQELBQADggGBADD0/UuTTFgW+CGk2U0RDw2RBOca
|
17
|
+
W2LTF/G7AOzuzD0Tc4voc7WXyrgKwJREv8rgBimLnNlgmFJLmtUCh2U/MgxvcilH
|
18
|
+
yshYcbseNvjkrtYnLRlWZR4SSB6Zei5AlyGVQLPkvdsBpNegcG6w075YEwzX/38a
|
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/docker-compose.yml
CHANGED
@@ -5,7 +5,7 @@ services:
|
|
5
5
|
ports:
|
6
6
|
- "2181:2181"
|
7
7
|
kafka:
|
8
|
-
image: wurstmeister/kafka:
|
8
|
+
image: wurstmeister/kafka:2.12-2.5.0
|
9
9
|
ports:
|
10
10
|
- "9092:9092"
|
11
11
|
environment:
|
@@ -13,5 +13,6 @@ services:
|
|
13
13
|
KAFKA_ADVERTISED_PORT: 9092
|
14
14
|
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
15
15
|
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
|
16
|
+
KAFKA_CREATE_TOPICS: 'example_topic:1:1'
|
16
17
|
volumes:
|
17
18
|
- /var/run/docker.sock:/var/run/docker.sock
|
data/lib/water_drop/config.rb
CHANGED
@@ -11,29 +11,41 @@ module WaterDrop
|
|
11
11
|
#
|
12
12
|
# option [String] id of the producer. This can be helpful when building producer specific
|
13
13
|
# instrumentation or loggers. It is not the kafka producer id
|
14
|
-
setting(
|
14
|
+
setting(
|
15
|
+
:id,
|
16
|
+
default: false,
|
17
|
+
constructor: ->(id) { id || SecureRandom.uuid }
|
18
|
+
)
|
15
19
|
# option [Instance] logger that we want to use
|
16
20
|
# @note Due to how rdkafka works, this setting is global for all the producers
|
17
|
-
setting(
|
21
|
+
setting(
|
22
|
+
:logger,
|
23
|
+
default: false,
|
24
|
+
constructor: ->(logger) { logger || Logger.new($stdout, level: Logger::WARN) }
|
25
|
+
)
|
18
26
|
# option [Instance] monitor that we want to use. See instrumentation part of the README for
|
19
27
|
# more details
|
20
|
-
setting(
|
28
|
+
setting(
|
29
|
+
:monitor,
|
30
|
+
default: false,
|
31
|
+
constructor: ->(monitor) { monitor || WaterDrop::Instrumentation::Monitor.new }
|
32
|
+
)
|
21
33
|
# option [Integer] max payload size allowed for delivery to Kafka
|
22
|
-
setting :max_payload_size, 1_000_012
|
34
|
+
setting :max_payload_size, default: 1_000_012
|
23
35
|
# option [Integer] Wait that long for the delivery report or raise an error if this takes
|
24
36
|
# longer than the timeout.
|
25
|
-
setting :max_wait_timeout, 5
|
37
|
+
setting :max_wait_timeout, default: 5
|
26
38
|
# option [Numeric] how long should we wait between re-checks on the availability of the
|
27
39
|
# delivery report. In a really robust systems, this describes the min-delivery time
|
28
40
|
# for a single sync message when produced in isolation
|
29
|
-
setting :wait_timeout, 0.005 # 5 milliseconds
|
41
|
+
setting :wait_timeout, default: 0.005 # 5 milliseconds
|
30
42
|
# option [Boolean] should we send messages. Setting this to false can be really useful when
|
31
43
|
# testing and or developing because when set to false, won't actually ping Kafka but will
|
32
44
|
# run all the validations, etc
|
33
|
-
setting :deliver, true
|
45
|
+
setting :deliver, default: true
|
34
46
|
# rdkafka options
|
35
47
|
# @see https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
|
36
|
-
setting :kafka, {}
|
48
|
+
setting :kafka, default: {}
|
37
49
|
|
38
50
|
# Configuration method
|
39
51
|
# @yield Runs a block of code providing a config singleton instance to it
|
@@ -22,6 +22,7 @@ module WaterDrop
|
|
22
22
|
required(:payload).filled(:str?)
|
23
23
|
optional(:key).maybe(:str?, :filled?)
|
24
24
|
optional(:partition).filled(:int?, gteq?: -1)
|
25
|
+
optional(:partition_key).maybe(:str?, :filled?)
|
25
26
|
optional(:timestamp).maybe { time? | int? }
|
26
27
|
optional(:headers).maybe(:hash?)
|
27
28
|
end
|
data/lib/water_drop/producer.rb
CHANGED
@@ -70,12 +70,13 @@ module WaterDrop
|
|
70
70
|
|
71
71
|
# We undefine all the finalizers, in case it was a fork, so the finalizers from the parent
|
72
72
|
# process don't leak
|
73
|
-
ObjectSpace.undefine_finalizer(
|
73
|
+
ObjectSpace.undefine_finalizer(id)
|
74
74
|
# Finalizer tracking is needed for handling shutdowns gracefully.
|
75
75
|
# I don't expect everyone to remember about closing all the producers all the time, thus
|
76
76
|
# this approach is better. Although it is still worth keeping in mind, that this will
|
77
|
-
# block GC from removing a no longer used producer unless closed properly
|
78
|
-
|
77
|
+
# block GC from removing a no longer used producer unless closed properly but at least
|
78
|
+
# won't crash the VM upon closing the process
|
79
|
+
ObjectSpace.define_finalizer(id, proc { close })
|
79
80
|
|
80
81
|
@pid = Process.pid
|
81
82
|
@client = Builder.new.call(self, @config)
|
@@ -98,15 +99,17 @@ module WaterDrop
|
|
98
99
|
|
99
100
|
# No need for auto-gc if everything got closed by us
|
100
101
|
# This should be used only in case a producer was not closed properly and forgotten
|
101
|
-
ObjectSpace.undefine_finalizer(
|
102
|
+
ObjectSpace.undefine_finalizer(id)
|
102
103
|
|
103
|
-
# Flush has
|
104
|
+
# Flush has its own buffer mutex but even if it is blocked, flushing can still happen
|
104
105
|
# as we close the client after the flushing (even if blocked by the mutex)
|
105
|
-
flush(
|
106
|
+
flush(true)
|
106
107
|
|
107
108
|
# We should not close the client in several threads the same time
|
108
109
|
# It is safe to run it several times but not exactly the same moment
|
109
|
-
|
110
|
+
# We also mark it as closed only if it was connected, if not, it would trigger a new
|
111
|
+
# connection that anyhow would be immediately closed
|
112
|
+
client.close if @client
|
110
113
|
|
111
114
|
@status.closed!
|
112
115
|
end
|
data/lib/water_drop/version.rb
CHANGED
data/waterdrop.gemspec
CHANGED
@@ -14,16 +14,16 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = 'https://github.com/karafka/waterdrop'
|
15
15
|
spec.summary = 'Kafka messaging made easy!'
|
16
16
|
spec.description = spec.summary
|
17
|
-
spec.license = '
|
17
|
+
spec.license = 'MIT'
|
18
18
|
|
19
19
|
spec.add_dependency 'concurrent-ruby', '>= 1.1'
|
20
|
-
spec.add_dependency 'dry-configurable', '~> 0.
|
21
|
-
spec.add_dependency 'dry-monitor', '~> 0.
|
22
|
-
spec.add_dependency 'dry-validation', '~> 1.
|
23
|
-
spec.add_dependency 'rdkafka', '>= 0.
|
24
|
-
spec.add_dependency 'zeitwerk', '~> 2.
|
20
|
+
spec.add_dependency 'dry-configurable', '~> 0.13'
|
21
|
+
spec.add_dependency 'dry-monitor', '~> 0.5'
|
22
|
+
spec.add_dependency 'dry-validation', '~> 1.7'
|
23
|
+
spec.add_dependency 'rdkafka', '>= 0.10'
|
24
|
+
spec.add_dependency 'zeitwerk', '~> 2.3'
|
25
25
|
|
26
|
-
spec.required_ruby_version = '>= 2.
|
26
|
+
spec.required_ruby_version = '>= 2.6.0'
|
27
27
|
|
28
28
|
if $PROGRAM_NAME.end_with?('gem')
|
29
29
|
spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waterdrop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -11,30 +11,30 @@ cert_chain:
|
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhtYWNp
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
14
|
+
ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMjEwODExMTQxNTEzWhcNMjIwODExMTQx
|
15
|
+
NTEzWjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
|
16
|
+
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDV2jKH4Ti87GM6nyT6D+ESzTI0MZDj
|
17
|
+
ak2/TEwnxvijMJyCCPKT/qIkbW4/f0VHM4rhPr1nW73sb5SZBVFCLlJcOSKOBdUY
|
18
|
+
TMY+SIXN2EtUaZuhAOe8LxtxjHTgRHvHcqUQMBENXTISNzCo32LnUxweu66ia4Pd
|
19
|
+
1mNRhzOqNv9YiBZvtBf7IMQ+sYdOCjboq2dlsWmJiwiDpY9lQBTnWORnT3mQxU5x
|
20
|
+
vPSwnLB854cHdCS8fQo4DjeJBRZHhEbcE5sqhEMB3RZA3EtFVEXOxlNxVTS3tncI
|
21
|
+
qyNXiWDaxcipaens4ObSY1C2HTV7OWb7OMqSCIybeYTSfkaSdqmcl4S6zxXkjH1J
|
22
|
+
tnjayAVzD+QVXGijsPLE2PFnJAh9iDET2cMsjabO1f6l1OQNyAtqpcyQcgfnyW0z
|
23
|
+
g7tGxTYD+6wJHffM9d9txOUw6djkF6bDxyqB8lo4Z3IObCx18AZjI9XPS9QG7w6q
|
24
|
+
LCWuMG2lkCcRgASqaVk9fEf9yMc2xxz5o3kCAwEAAaN3MHUwCQYDVR0TBAIwADAL
|
25
|
+
BgNVHQ8EBAMCBLAwHQYDVR0OBBYEFBqUFCKCOe5IuueUVqOB991jyCLLMB0GA1Ud
|
26
26
|
EQQWMBSBEm1hY2llakBtZW5zZmVsZC5wbDAdBgNVHRIEFjAUgRJtYWNpZWpAbWVu
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
c2ZlbGQucGwwDQYJKoZIhvcNAQELBQADggGBADD0/UuTTFgW+CGk2U0RDw2RBOca
|
28
|
+
W2LTF/G7AOzuzD0Tc4voc7WXyrgKwJREv8rgBimLnNlgmFJLmtUCh2U/MgxvcilH
|
29
|
+
yshYcbseNvjkrtYnLRlWZR4SSB6Zei5AlyGVQLPkvdsBpNegcG6w075YEwzX/38a
|
30
|
+
8V9B/Yri2OGELBz8ykl7BsXUgNoUPA/4pHF6YRLz+VirOaUIQ4JfY7xGj6fSOWWz
|
31
|
+
/rQ/d77r6o1mfJYM/3BRVg73a3b7DmRnE5qjwmSaSQ7u802pJnLesmArch0xGCT/
|
32
|
+
fMmRli1Qb+6qOTl9mzD6UDMAyFR4t6MStLm0mIEqM0nBO5nUdUWbC7l9qXEf8XBE
|
33
|
+
2DP28p3EqSuS+lKbAWKcqv7t0iRhhmaod+Yn9mcrLN1sa3q3KSQ9BCyxezCD4Mk2
|
34
|
+
R2P11bWoCtr70BsccVrN8jEhzwXngMyI2gVt750Y+dbTu1KgRqZKp/ECe7ZzPzXj
|
35
|
+
pIy9vHxTANKYVyI4qj8OrFdEM5BQNu8oQpL0iQ==
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date:
|
37
|
+
date: 2021-09-19 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: concurrent-ruby
|
@@ -56,70 +56,70 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '0.
|
59
|
+
version: '0.13'
|
60
60
|
type: :runtime
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '0.
|
66
|
+
version: '0.13'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: dry-monitor
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
71
|
- - "~>"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: '0.
|
73
|
+
version: '0.5'
|
74
74
|
type: :runtime
|
75
75
|
prerelease: false
|
76
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
78
|
- - "~>"
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: '0.
|
80
|
+
version: '0.5'
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: dry-validation
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '1.
|
87
|
+
version: '1.7'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: '1.
|
94
|
+
version: '1.7'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: rdkafka
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
99
|
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 0.
|
101
|
+
version: '0.10'
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: 0.
|
108
|
+
version: '0.10'
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: zeitwerk
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
113
|
- - "~>"
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: '2.
|
115
|
+
version: '2.3'
|
116
116
|
type: :runtime
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
120
|
- - "~>"
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: '2.
|
122
|
+
version: '2.3'
|
123
123
|
description: Kafka messaging made easy!
|
124
124
|
email:
|
125
125
|
- maciej@mensfeld.pl
|
@@ -129,7 +129,6 @@ extra_rdoc_files: []
|
|
129
129
|
files:
|
130
130
|
- ".coditsu/ci.yml"
|
131
131
|
- ".diffend.yml"
|
132
|
-
- ".github/FUNDING.yml"
|
133
132
|
- ".github/workflows/ci.yml"
|
134
133
|
- ".gitignore"
|
135
134
|
- ".rspec"
|
@@ -138,7 +137,7 @@ files:
|
|
138
137
|
- CHANGELOG.md
|
139
138
|
- Gemfile
|
140
139
|
- Gemfile.lock
|
141
|
-
- LICENSE
|
140
|
+
- MIT-LICENSE
|
142
141
|
- README.md
|
143
142
|
- certs/mensfeld.pem
|
144
143
|
- config/errors.yml
|
@@ -166,7 +165,7 @@ files:
|
|
166
165
|
- waterdrop.gemspec
|
167
166
|
homepage: https://github.com/karafka/waterdrop
|
168
167
|
licenses:
|
169
|
-
-
|
168
|
+
- MIT
|
170
169
|
metadata: {}
|
171
170
|
post_install_message:
|
172
171
|
rdoc_options: []
|
@@ -176,14 +175,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
176
175
|
requirements:
|
177
176
|
- - ">="
|
178
177
|
- !ruby/object:Gem::Version
|
179
|
-
version: 2.
|
178
|
+
version: 2.6.0
|
180
179
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
180
|
requirements:
|
182
181
|
- - ">="
|
183
182
|
- !ruby/object:Gem::Version
|
184
183
|
version: '0'
|
185
184
|
requirements: []
|
186
|
-
rubygems_version: 3.
|
185
|
+
rubygems_version: 3.2.27
|
187
186
|
signing_key:
|
188
187
|
specification_version: 4
|
189
188
|
summary: Kafka messaging made easy!
|
metadata.gz.sig
CHANGED
Binary file
|
data/.github/FUNDING.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
open_collective: karafka
|
data/LICENSE
DELETED
@@ -1,165 +0,0 @@
|
|
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.
|