waterdrop 2.4.8 → 2.4.9

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: 8fab3f2b565a128bcc34f8d8bd10b36b0bd9546d1c52109a97ad87449fcd1731
4
- data.tar.gz: 891f381590986451b330f74ac0ab56e6d2873d84a778d33bf470db1fe5e8447d
3
+ metadata.gz: e2e707af4409ace682680ca2131b89221ee04552b856a0855e663a209e09e0fb
4
+ data.tar.gz: fed47f90aa9397754ec6819fcc720d18ad3cace184a053ca6dbbec1b86480172
5
5
  SHA512:
6
- metadata.gz: de29a31f2d498bfd04577ddd7edec90603d1226bc9b355d3e65e62fae0e2cb0f89bc5708a0734425df0fc5458adcb01e5b59775fda3daaceab1de586b41ed07d
7
- data.tar.gz: 052ea95a7c819c42ba62c1275b4895cf9b034e429ef34af0d4556965dd28cd0a9307a0a5613f3a126b4e41da6b0cfe8042e3f614045929203faca67c496d4352
6
+ metadata.gz: 8e2fa6d1abbaa0cae44a8a8fd5e17ef64a851e48c0433d74ca259a52747b92aa94beeabf2ccbc8c3df3efec67050f04b22cafb346f8f69d279effe86590a7079
7
+ data.tar.gz: 5eefb7ba3ae2c3f1ce6253fd5206762c4fd94698719968f42a3e7ddd5cc18a90459ed2eddc29c01452fd9c211cd1e57cb71f66338b428eaf71e0b3ddb0eb45c2
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # WaterDrop changelog
2
2
 
3
+ ## 2.4.9 (2023-01-11)
4
+ - Remove empty debug logging out of `LoggerListener`.
5
+ - Do not lock Ruby version in Karafka in favour of `karafka-core`.
6
+ - Make sure `karafka-core` version is at least `2.0.9` to make sure we run `karafka-rdkafka`.
7
+
3
8
  ## 2.4.8 (2023-01-07)
4
9
  - Use monotonic time from Karafka core.
5
10
 
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waterdrop (2.4.8)
5
- karafka-core (>= 2.0.8, < 3.0.0)
4
+ waterdrop (2.4.9)
5
+ karafka-core (>= 2.0.9, < 3.0.0)
6
6
  zeitwerk (~> 2.3)
7
7
 
8
8
  GEM
@@ -22,26 +22,26 @@ GEM
22
22
  ffi (1.15.5)
23
23
  i18n (1.12.0)
24
24
  concurrent-ruby (~> 1.0)
25
- karafka-core (2.0.8)
25
+ karafka-core (2.0.9)
26
26
  concurrent-ruby (>= 1.1)
27
- rdkafka (>= 0.12)
28
- mini_portile2 (2.8.1)
29
- minitest (5.17.0)
30
- rake (13.0.6)
31
- rdkafka (0.12.0)
27
+ karafka-rdkafka (>= 0.12)
28
+ karafka-rdkafka (0.12.0)
32
29
  ffi (~> 1.15)
33
30
  mini_portile2 (~> 2.6)
34
31
  rake (> 12)
32
+ mini_portile2 (2.8.1)
33
+ minitest (5.17.0)
34
+ rake (13.0.6)
35
35
  rspec (3.12.0)
36
36
  rspec-core (~> 3.12.0)
37
37
  rspec-expectations (~> 3.12.0)
38
38
  rspec-mocks (~> 3.12.0)
39
39
  rspec-core (3.12.0)
40
40
  rspec-support (~> 3.12.0)
41
- rspec-expectations (3.12.1)
41
+ rspec-expectations (3.12.2)
42
42
  diff-lcs (>= 1.2.0, < 2.0)
43
43
  rspec-support (~> 3.12.0)
44
- rspec-mocks (3.12.1)
44
+ rspec-mocks (3.12.2)
45
45
  diff-lcs (>= 1.2.0, < 2.0)
46
46
  rspec-support (~> 3.12.0)
47
47
  rspec-support (3.12.0)
@@ -56,7 +56,6 @@ GEM
56
56
  zeitwerk (2.6.6)
57
57
 
58
58
  PLATFORMS
59
- arm64-darwin
60
59
  x86_64-linux
61
60
 
62
61
  DEPENDENCIES
data/README.md CHANGED
@@ -33,6 +33,7 @@ It:
33
33
  - [Instrumentation](#instrumentation)
34
34
  * [Usage statistics](#usage-statistics)
35
35
  * [Error notifications](#error-notifications)
36
+ * [Acknowledgment notifications](#acknowledgment-notifications)
36
37
  * [Datadog and StatsD integration](#datadog-and-statsd-integration)
37
38
  * [Forking and potential memory problems](#forking-and-potential-memory-problems)
38
39
  - [Middleware](#middleware)
@@ -352,6 +353,65 @@ producer.close
352
353
 
353
354
  Note: The metrics returned may not be completely consistent between brokers, toppars and totals, due to the internal asynchronous nature of librdkafka. E.g., the top level tx total may be less than the sum of the broker tx values which it represents.
354
355
 
356
+ ### Error notifications
357
+
358
+ WaterDrop allows you to listen to all errors that occur while producing messages and in its internal background threads. Things like reconnecting to Kafka upon network errors and others unrelated to publishing messages are all available under `error.occurred` notification key. You can subscribe to this event to ensure your setup is healthy and without any problems that would otherwise go unnoticed as long as messages are delivered.
359
+
360
+ ```ruby
361
+ producer = WaterDrop::Producer.new do |config|
362
+ # Note invalid connection port...
363
+ config.kafka = { 'bootstrap.servers': 'localhost:9090' }
364
+ end
365
+
366
+ producer.monitor.subscribe('error.occurred') do |event|
367
+ error = event[:error]
368
+
369
+ p "WaterDrop error occurred: #{error}"
370
+ end
371
+
372
+ # Run this code without Kafka cluster
373
+ loop do
374
+ producer.produce_async(topic: 'events', payload: 'data')
375
+
376
+ sleep(1)
377
+ end
378
+
379
+ # After you stop your Kafka cluster, you will see a lot of those:
380
+ #
381
+ # WaterDrop error occurred: Local: Broker transport failure (transport)
382
+ #
383
+ # WaterDrop error occurred: Local: Broker transport failure (transport)
384
+ ```
385
+
386
+ ### Acknowledgment notifications
387
+
388
+ WaterDrop allows you to listen to Kafka messages' acknowledgment events. This will enable you to monitor deliveries of messages from WaterDrop even when using asynchronous dispatch methods.
389
+
390
+ That way, you can make sure, that dispatched messages are acknowledged by Kafka.
391
+
392
+ ```ruby
393
+ producer = WaterDrop::Producer.new do |config|
394
+ config.kafka = { 'bootstrap.servers': 'localhost:9092' }
395
+ end
396
+
397
+ producer.monitor.subscribe('message.acknowledged') do |event|
398
+ producer_id = event[:producer_id]
399
+ offset = event[:offset]
400
+
401
+ p "WaterDrop [#{producer_id}] delivered message with offset: #{offset}"
402
+ end
403
+
404
+ loop do
405
+ producer.produce_async(topic: 'events', payload: 'data')
406
+
407
+ sleep(1)
408
+ end
409
+
410
+ # WaterDrop [dd8236fff672] delivered message with offset: 32
411
+ # WaterDrop [dd8236fff672] delivered message with offset: 33
412
+ # WaterDrop [dd8236fff672] delivered message with offset: 34
413
+ ```
414
+
355
415
  ### Datadog and StatsD integration
356
416
 
357
417
  WaterDrop comes with (optional) full Datadog and StatsD integration that you can use. To use it:
@@ -385,36 +445,6 @@ You can also find [here](https://github.com/karafka/waterdrop/blob/master/lib/wa
385
445
 
386
446
  ![Example WaterDrop DD dashboard](https://raw.githubusercontent.com/karafka/misc/master/printscreens/waterdrop_dd_dashboard_example.png)
387
447
 
388
- ### Error notifications
389
-
390
- WaterDrop allows you to listen to all errors that occur while producing messages and in its internal background threads. Things like reconnecting to Kafka upon network errors and others unrelated to publishing messages are all available under `error.occurred` notification key. You can subscribe to this event to ensure your setup is healthy and without any problems that would otherwise go unnoticed as long as messages are delivered.
391
-
392
- ```ruby
393
- producer = WaterDrop::Producer.new do |config|
394
- # Note invalid connection port...
395
- config.kafka = { 'bootstrap.servers': 'localhost:9090' }
396
- end
397
-
398
- producer.monitor.subscribe('error.occurred') do |event|
399
- error = event[:error]
400
-
401
- p "WaterDrop error occurred: #{error}"
402
- end
403
-
404
- # Run this code without Kafka cluster
405
- loop do
406
- producer.produce_async(topic: 'events', payload: 'data')
407
-
408
- sleep(1)
409
- end
410
-
411
- # After you stop your Kafka cluster, you will see a lot of those:
412
- #
413
- # WaterDrop error occurred: Local: Broker transport failure (transport)
414
- #
415
- # WaterDrop error occurred: Local: Broker transport failure (transport)
416
- ```
417
-
418
448
  ### Forking and potential memory problems
419
449
 
420
450
  If you work with forked processes, make sure you **don't** use the producer before the fork. You can easily configure the producer and then fork and use it.
@@ -82,7 +82,6 @@ module WaterDrop
82
82
  # @param event [Dry::Events::Event] event that happened with the details
83
83
  def on_producer_closed(event)
84
84
  info event, 'Closing producer'
85
- debug event, ''
86
85
  end
87
86
 
88
87
  # @param event [Dry::Events::Event] event that happened with the error details
@@ -91,7 +90,6 @@ module WaterDrop
91
90
  type = event[:type]
92
91
 
93
92
  error(event, "Error occurred: #{error} - #{type}")
94
- debug(event, '')
95
93
  end
96
94
 
97
95
  private
@@ -3,5 +3,5 @@
3
3
  # WaterDrop library
4
4
  module WaterDrop
5
5
  # Current WaterDrop version
6
- VERSION = '2.4.8'
6
+ VERSION = '2.4.9'
7
7
  end
data/waterdrop.gemspec CHANGED
@@ -16,11 +16,9 @@ Gem::Specification.new do |spec|
16
16
  spec.description = spec.summary
17
17
  spec.license = 'MIT'
18
18
 
19
- spec.add_dependency 'karafka-core', '>= 2.0.8', '< 3.0.0'
19
+ spec.add_dependency 'karafka-core', '>= 2.0.9', '< 3.0.0'
20
20
  spec.add_dependency 'zeitwerk', '~> 2.3'
21
21
 
22
- spec.required_ruby_version = '>= 2.7'
23
-
24
22
  if $PROGRAM_NAME.end_with?('gem')
25
23
  spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
26
24
  end
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.4.8
4
+ version: 2.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
36
36
  MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
37
37
  -----END CERTIFICATE-----
38
- date: 2023-01-07 00:00:00.000000000 Z
38
+ date: 2023-01-11 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: karafka-core
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 2.0.8
46
+ version: 2.0.9
47
47
  - - "<"
48
48
  - !ruby/object:Gem::Version
49
49
  version: 3.0.0
@@ -53,7 +53,7 @@ dependencies:
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 2.0.8
56
+ version: 2.0.9
57
57
  - - "<"
58
58
  - !ruby/object:Gem::Version
59
59
  version: 3.0.0
@@ -135,14 +135,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '2.7'
138
+ version: '0'
139
139
  required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubygems_version: 3.4.1
145
+ rubygems_version: 3.3.4
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: Kafka messaging made easy!
metadata.gz.sig CHANGED
Binary file