karafka 1.4.2 → 1.4.3

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: b67c595b8ce4b5ff1589517547f94c8e1ba4caf51361074949b7bae1c5368bf6
4
- data.tar.gz: 17c507ddf4d2b4cd62eea3df3a1dec0cef5a257054f7d0321e1c71dcba0d400e
3
+ metadata.gz: 0fae4fb99cb42515602d9f27a6d7a5bd7485e4e0b40868a6856766ebe7b50083
4
+ data.tar.gz: b82635f328ba711f836da733dd0ec5ed415446d3209918a20f7b6f42ff1e1ac2
5
5
  SHA512:
6
- metadata.gz: 818d4d75303eda22f8e923e7ade1c445f0c2e99aebdb7e56511b5fdf38ea39c047f61c0983bc8d38641676be2c2fcc901df9d2bc0d812c3454664dd73ab27b2e
7
- data.tar.gz: 5c10aced279e74af09d42dd3367a1593abf11267cb09099d0d92a3b4e540f19fa3c06bd9e0f61f7025c3fc0774cde9f4902fb929ca9e24aa308f9d72e6a61def
6
+ metadata.gz: f90e7c6757cd517649c0021f759db091c050899c8a7846d022fa58e117db61cb5a3f6ee640b452f43017e0b504b0ba6a3b075886b266438daf1098d0fa2bc48d
7
+ data.tar.gz: 7ab841ff7269992e90a17a88159baa9be67ab35866f8d174a434bd6efbecceb1521bbf142b6c9ebb37cabbea8a125e49b60fde3844b2a0e6ce3b62ef941b6a75
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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 * * *'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 1.4.3 (2021-03-24)
4
+ - Fixes for Ruby 3.0 compatibility
5
+
3
6
  ## 1.4.2 (2021-02-16)
4
7
  - Rescue Errno::EROFS in ensure_dir_exists (unasuke)
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (1.4.2)
4
+ karafka (1.4.3)
5
5
  dry-configurable (~> 0.8)
6
6
  dry-inflector (~> 0.1)
7
7
  dry-monitor (~> 0.3)
@@ -81,11 +81,11 @@ GEM
81
81
  activesupport (>= 5.0.0)
82
82
  i18n (1.8.9)
83
83
  concurrent-ruby (~> 1.0)
84
- io-console (0.5.8)
84
+ io-console (0.5.9)
85
85
  irb (1.3.4)
86
86
  reline (>= 0.1.5)
87
87
  king_konf (1.0.0)
88
- minitest (5.14.3)
88
+ minitest (5.14.4)
89
89
  rake (13.0.3)
90
90
  reline (0.2.4)
91
91
  io-console (~> 0.5)
@@ -113,7 +113,7 @@ GEM
113
113
  thor (1.1.0)
114
114
  tzinfo (2.0.4)
115
115
  concurrent-ruby (~> 1.0)
116
- waterdrop (1.4.0)
116
+ waterdrop (1.4.1)
117
117
  delivery_boy (>= 0.2, < 2.x)
118
118
  dry-configurable (~> 0.8)
119
119
  dry-monitor (~> 0.3)
@@ -123,8 +123,7 @@ GEM
123
123
  zeitwerk (2.4.2)
124
124
 
125
125
  PLATFORMS
126
- ruby
127
- x86_64-darwin-19
126
+ x86_64-linux
128
127
 
129
128
  DEPENDENCIES
130
129
  byebug
@@ -134,4 +133,4 @@ DEPENDENCIES
134
133
  simplecov
135
134
 
136
135
  BUNDLED WITH
137
- 2.2.11
136
+ 2.2.15
data/README.md CHANGED
@@ -1,10 +1,12 @@
1
1
  ![karafka logo](https://raw.githubusercontent.com/karafka/misc/master/logo/karafka_logotype_transparent2.png)
2
2
 
3
- [![Build Status](https://travis-ci.org/karafka/karafka.svg?branch=master)](https://travis-ci.org/karafka/karafka)
3
+ [![Build Status](https://github.com/karafka/karafka/actions/workflows/ci.yml/badge.svg)](https://github.com/karafka/karafka/actions/workflows/ci.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/karafka.svg)](http://badge.fury.io/rb/karafka)
5
+ [![Join the chat at https://gitter.im/karafka/karafka](https://badges.gitter.im/karafka/karafka.svg)](https://gitter.im/karafka/karafka)
4
6
 
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).
7
+ **Note**: We're finishing the new Karafka `2.0` but for now, please use `1.4`. All the documentation presented here refers to `1.4`
8
+ ..
9
+ Documentation presented here refers to Karafka `1.4`.
8
10
 
9
11
  ## About Karafka
10
12
 
@@ -72,7 +74,7 @@ Karafka framework and Karafka team are __not__ related to Kafka streaming servic
72
74
  ## References
73
75
 
74
76
  * [Karafka framework](https://github.com/karafka/karafka)
75
- * [Karafka Travis CI](https://travis-ci.org/karafka/karafka)
77
+ * [Karafka GitHub Actions](https://github.com/karafka/karafka/actions)
76
78
  * [Karafka Coditsu](https://app.coditsu.io/karafka/repositories/karafka)
77
79
 
78
80
  ## Note on contributions
@@ -34,7 +34,7 @@ module Karafka
34
34
  Bundler.read_file(
35
35
  Bundler.default_lockfile
36
36
  )
37
- ).dependencies.key?('rails')
37
+ ).dependencies.key?('railties')
38
38
  end
39
39
 
40
40
  # Install all required things for Karafka application in current directory
@@ -31,14 +31,6 @@ module Karafka
31
31
  # part of the topics
32
32
  Karafka::Server.consumer_groups = cli.options[:consumer_groups]
33
33
 
34
- # Remove pidfile on stop, just before the server instance is going to be GCed
35
- # We want to delay the moment in which the pidfile is removed as much as we can,
36
- # so instead of removing it after the server stops running, we rely on the gc moment
37
- # when this object gets removed (it is a bit later), so it is closer to the actual
38
- # system process end. We do that, so monitoring and deployment tools that rely on a pid
39
- # won't alarm or start new system process up until the current one is finished
40
- ObjectSpace.define_finalizer(self, proc { send(:clean) })
41
-
42
34
  Karafka::Server.run
43
35
  end
44
36
 
@@ -60,6 +52,14 @@ module Karafka
60
52
  cli.options[:pid],
61
53
  'w'
62
54
  ) { |file| file.write(::Process.pid) }
55
+
56
+ # Remove pidfile on stop, just before the server instance is going to be GCed
57
+ # We want to delay the moment in which the pidfile is removed as much as we can,
58
+ # so instead of removing it after the server stops running, we rely on the gc moment
59
+ # when this object gets removed (it is a bit later), so it is closer to the actual
60
+ # system process end. We do that, so monitoring and deployment tools that rely on a pid
61
+ # won't alarm or start new system process up until the current one is finished
62
+ ObjectSpace.define_finalizer(self, proc { send(:clean) })
63
63
  end
64
64
 
65
65
  # Removes a pidfile (if exist)
@@ -48,30 +48,28 @@ module Karafka
48
48
 
49
49
  # Builds all the configuration settings for kafka#consumer method
50
50
  # @param consumer_group [Karafka::Routing::ConsumerGroup] consumer group details
51
- # @return [Array<Hash>] array with all the consumer arguments including hash with all
51
+ # @return [Hash] all the consumer keyword arguments including hash with all
52
52
  # the settings required by Kafka#consumer
53
53
  def consumer(consumer_group)
54
54
  settings = { group_id: consumer_group.id }
55
55
  settings = fetch_for(:consumer, consumer_group, settings)
56
- [sanitize(settings)]
56
+ sanitize(settings)
57
57
  end
58
58
 
59
59
  # Builds all the configuration settings for kafka consumer consume_each_batch and
60
60
  # consume_each_message methods
61
61
  # @param consumer_group [Karafka::Routing::ConsumerGroup] consumer group details
62
- # @return [Array<Hash>] Array with all the arguments required by consuming method
63
- # including hash with all the settings required by
62
+ # @return [Hash] hash with all the arguments required by consuming method
63
+ # including all the settings required by
64
64
  # Kafka::Consumer#consume_each_message and Kafka::Consumer#consume_each_batch method
65
65
  def consumption(consumer_group)
66
- [
67
- sanitize(
68
- fetch_for(
69
- :consumption,
70
- consumer_group,
71
- automatically_mark_as_processed: consumer_group.automatically_mark_as_consumed
72
- )
66
+ sanitize(
67
+ fetch_for(
68
+ :consumption,
69
+ consumer_group,
70
+ automatically_mark_as_processed: consumer_group.automatically_mark_as_consumed
73
71
  )
74
- ]
72
+ )
75
73
  end
76
74
 
77
75
  # Builds all the configuration settings for kafka consumer#subscribe method
@@ -10,7 +10,12 @@ module Karafka
10
10
  # to have a new Kafka client
11
11
  # @return [::Kafka::Client] returns a Kafka client
12
12
  def call(consumer_group)
13
- Kafka.new(*ApiAdapter.client(consumer_group))
13
+ settings = ApiAdapter.client(consumer_group)
14
+
15
+ Kafka.new(
16
+ settings[0],
17
+ **settings[1]
18
+ )
14
19
  end
15
20
  end
16
21
  end
@@ -33,9 +33,9 @@ module Karafka
33
33
  settings = ApiAdapter.consumption(consumer_group)
34
34
 
35
35
  if consumer_group.batch_fetching
36
- kafka_consumer.each_batch(*settings) { |batch| yield(batch, :batch) }
36
+ kafka_consumer.each_batch(**settings) { |batch| yield(batch, :batch) }
37
37
  else
38
- kafka_consumer.each_message(*settings) { |message| yield(message, :message) }
38
+ kafka_consumer.each_message(**settings) { |message| yield(message, :message) }
39
39
  end
40
40
  # @note We catch only the processing errors as any other are considered critical (exceptions)
41
41
  # and should require a client restart with a backoff
@@ -98,10 +98,12 @@ module Karafka
98
98
  # @note We don't cache the connection internally because we cache kafka_consumer that uses
99
99
  # kafka client object instance
100
100
  @kafka_consumer ||= Builder.call(consumer_group).consumer(
101
- *ApiAdapter.consumer(consumer_group)
101
+ **ApiAdapter.consumer(consumer_group)
102
102
  ).tap do |consumer|
103
103
  consumer_group.topics.each do |topic|
104
- consumer.subscribe(*ApiAdapter.subscribe(topic))
104
+ settings = ApiAdapter.subscribe(topic)
105
+
106
+ consumer.subscribe(settings[0], **settings[1])
105
107
  end
106
108
  end
107
109
  rescue Kafka::ConnectionError
@@ -58,7 +58,7 @@ module Karafka
58
58
  def stop_supervised
59
59
  Karafka::App.stop!
60
60
 
61
- # Temporary patch until https://github.com/dry-rb/dry-configurable/issues/93 is fixed
61
+ # See https://github.com/dry-rb/dry-configurable/issues/93
62
62
  timeout = Thread.new { Karafka::App.config.shutdown_timeout }.join.value
63
63
 
64
64
  # We check from time to time (for the timeout period) if all the threads finished
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '1.4.2'
6
+ VERSION = '1.4.3'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -36,7 +36,7 @@ cert_chain:
36
36
  2DND//YJUikn1zwbz1kT70XmHd97B4Eytpln7K+M1u2g1pHVEPW4owD/ammXNpUy
37
37
  nt70FcDD4yxJQ+0YNiHd0N8IcVBM1TMIVctMNQ==
38
38
  -----END CERTIFICATE-----
39
- date: 2021-02-26 00:00:00.000000000 Z
39
+ date: 2021-03-24 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dry-configurable
metadata.gz.sig CHANGED
Binary file