karafka 2.0.35 → 2.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2d2197fb0fe7eae8db43cc45ffbdcdc6da83d60731ae63b82dc4a24d852736e
4
- data.tar.gz: 76b4b3f8ffb915b96a16f1eb83503283e5da46039fb952af383322773c4be551
3
+ metadata.gz: 128d19fa065cbb43fae7a23a424e44ec30077fe58c93d7c122da299ec5b98df1
4
+ data.tar.gz: 0b396fa75d93257f32a9ddf94f0dc89d2456b6ed07acad5c581908d148cf0a6f
5
5
  SHA512:
6
- metadata.gz: 35d69a8fa9a26462f2167174d8700648909bbcf38363c5adef2f7ee42995b524c0d244bffe0bd76698f65df5475db78b38914f38d7eda239376c4031555ee885
7
- data.tar.gz: 49a2256930ce83bc46b6471cf702b1ea2fe6f897a805f92e4dee7c3d9034a9625a44ecff0222b8396ed73858af5571cca4eaabca8d188a81312312c2225daa97
6
+ metadata.gz: 68d4da94eaf7a1033c95dd02bdc9a4bd8e69040df4db304dbcb6f8255997a40c003c999eea6442f6c1a1640c3e1ed44032c3826191e96085afbccc8600a8f2b6
7
+ data.tar.gz: 025fbc8edb26f6f8442e11ea90afdc3e07873efcba3f6778549cd66e0738dfec73d956d877c44ea39bc1064c22df9fca6d3c68a42ef97ad4438ed7812b690ea1
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 2.0.36 (2023-03-17)
4
+ - [Refactor] Rename internal naming of `Structurable` to `Declaratives` for declarative topics feature.
5
+ - [Fix] AJ + DLQ + MOM + LRJ is pausing indefinitely after the first job (#1362)
6
+
3
7
  ## 2.0.35 (2023-03-13)
4
8
  - **[Feature]** Allow for defining topics config via the DSL and its automatic creation via CLI command.
5
9
  - **[Feature]** Allow for full topics reset and topics repartitioning via the CLI.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (2.0.35)
4
+ karafka (2.0.36)
5
5
  karafka-core (>= 2.0.12, < 3.0.0)
6
6
  thor (>= 0.20)
7
7
  waterdrop (>= 2.4.10, < 3.0.0)
@@ -45,10 +45,10 @@ en:
45
45
  dead_letter_queue.topic_format: 'needs to be a string with a Kafka accepted format'
46
46
  dead_letter_queue.active_format: needs to be either true or false
47
47
  active_format: needs to be either true or false
48
- structurable.partitions_format: needs to be more or equal to 1
49
- structurable.active_format: needs to be true
50
- structurable.replication_factor_format: needs to be more or equal to 1
51
- structurable.details_format: needs to be a hash with only symbol keys
48
+ declaratives.partitions_format: needs to be more or equal to 1
49
+ declaratives.active_format: needs to be true
50
+ declaratives.replication_factor_format: needs to be more or equal to 1
51
+ declaratives.details_format: needs to be a hash with only symbol keys
52
52
  inconsistent_namespacing: |
53
53
  needs to be consistent namespacing style
54
54
  disable this validation by setting config.strict_topics_namespacing to false
@@ -29,7 +29,7 @@ module Karafka
29
29
 
30
30
  # Creates topics based on the routing setup and configuration
31
31
  def create
32
- structurable_routing_topics.each do |topic|
32
+ declaratives_routing_topics.each do |topic|
33
33
  name = topic.name
34
34
 
35
35
  if existing_topics_names.include?(name)
@@ -38,9 +38,9 @@ module Karafka
38
38
  puts "Creating topic #{name}..."
39
39
  Admin.create_topic(
40
40
  name,
41
- topic.structurable.partitions,
42
- topic.structurable.replication_factor,
43
- topic.structurable.details
41
+ topic.declaratives.partitions,
42
+ topic.declaratives.replication_factor,
43
+ topic.declaratives.details
44
44
  )
45
45
  puts "#{green('Created')} topic #{name}."
46
46
  end
@@ -49,7 +49,7 @@ module Karafka
49
49
 
50
50
  # Deletes routing based topics
51
51
  def delete
52
- structurable_routing_topics.each do |topic|
52
+ declaratives_routing_topics.each do |topic|
53
53
  name = topic.name
54
54
 
55
55
  if existing_topics_names.include?(name)
@@ -89,7 +89,7 @@ module Karafka
89
89
  [topic.fetch(:topic_name), topic.fetch(:partition_count)]
90
90
  end.to_h
91
91
 
92
- structurable_routing_topics.each do |topic|
92
+ declaratives_routing_topics.each do |topic|
93
93
  name = topic.name
94
94
 
95
95
  desired_count = topic.config.partitions
@@ -112,21 +112,21 @@ module Karafka
112
112
  # @note If topic is defined in multiple consumer groups, first config will be used. This
113
113
  # means, that this CLI will not work for simultaneous management of multiple clusters from
114
114
  # a single CLI command execution flow.
115
- def structurable_routing_topics
116
- return @structurable_routing_topics if @structurable_routing_topics
115
+ def declaratives_routing_topics
116
+ return @declaratives_routing_topics if @declaratives_routing_topics
117
117
 
118
118
  collected_topics = {}
119
119
 
120
120
  App.consumer_groups.each do |consumer_group|
121
121
  consumer_group.topics.each do |topic|
122
122
  # Skip topics that were explicitly disabled from management
123
- next unless topic.structurable.active?
123
+ next unless topic.declaratives.active?
124
124
 
125
125
  collected_topics[topic.name] ||= topic
126
126
  end
127
127
  end
128
128
 
129
- @structurable_routing_topics = collected_topics.values
129
+ @declaratives_routing_topics = collected_topics.values
130
130
  end
131
131
 
132
132
  # @return [Array<Hash>] existing topics details
@@ -23,8 +23,10 @@ module Karafka
23
23
  # This case is a bit of special. Please see the `AjDlqMom` for explanation on how the
24
24
  # offset management works in this case.
25
25
  module AjDlqLrjMom
26
- include AjLrjMom
27
- include AjDlqMom
26
+ # We can use the same code as for VP because non VP behaves like:
27
+ # - with one virtual partition
28
+ # - with "never ending" collapse
29
+ include AjDlqLrjMomVp
28
30
 
29
31
  # Features for this strategy
30
32
  FEATURES = %i[
@@ -3,8 +3,8 @@
3
3
  module Karafka
4
4
  module Routing
5
5
  module Features
6
- class Structurable < Base
7
- # Config for structurable feature
6
+ class Declaratives < Base
7
+ # Config for declarative topics feature
8
8
  Config = Struct.new(
9
9
  :active,
10
10
  :partitions,
@@ -3,7 +3,7 @@
3
3
  module Karafka
4
4
  module Routing
5
5
  module Features
6
- class Structurable < Base
6
+ class Declaratives < Base
7
7
  # Basic validation of the Kafka expected config details
8
8
  class Contract < Contracts::Base
9
9
  configure do |config|
@@ -14,7 +14,7 @@ module Karafka
14
14
  ).fetch('en').fetch('validations').fetch('topic')
15
15
  end
16
16
 
17
- nested :structurable do
17
+ nested :declaratives do
18
18
  required(:active) { |val| [true, false].include?(val) }
19
19
  required(:partitions) { |val| val.is_a?(Integer) && val.positive? }
20
20
  required(:replication_factor) { |val| val.is_a?(Integer) && val.positive? }
@@ -3,7 +3,7 @@
3
3
  module Karafka
4
4
  module Routing
5
5
  module Features
6
- class Structurable < Base
6
+ class Declaratives < Base
7
7
  # Extension for managing Kafka topic configuration
8
8
  module Topic
9
9
  # @param active [Boolean] is the topic structure management feature active
@@ -12,7 +12,7 @@ module Karafka
12
12
  # @param details [Hash] extra configuration for the topic
13
13
  # @return [Config] defined structure
14
14
  def config(active: true, partitions: 1, replication_factor: 1, **details)
15
- @structurable ||= Config.new(
15
+ @declaratives ||= Config.new(
16
16
  active: active,
17
17
  partitions: partitions,
18
18
  replication_factor: replication_factor,
@@ -21,20 +21,20 @@ module Karafka
21
21
  end
22
22
 
23
23
  # @return [Config] config details
24
- def structurable
24
+ def declaratives
25
25
  config
26
26
  end
27
27
 
28
- # @return [true] structurable is always active
29
- def structurable?
30
- structurable.active?
28
+ # @return [true] declaratives is always active
29
+ def declaratives?
30
+ declaratives.active?
31
31
  end
32
32
 
33
- # @return [Hash] topic with all its native configuration options plus structurable
33
+ # @return [Hash] topic with all its native configuration options plus declaratives
34
34
  # settings
35
35
  def to_h
36
36
  super.merge(
37
- structurable: structurable.to_h
37
+ declaratives: declaratives.to_h
38
38
  ).freeze
39
39
  end
40
40
  end
@@ -7,7 +7,7 @@ module Karafka
7
7
  # topics structure for test/development, etc. This allows to share the same set of settings
8
8
  # for topics despite the environment. Pretty much similar to how the `structure.sql` or
9
9
  # `schema.rb` operate for SQL dbs.
10
- class Structurable < Base
10
+ class Declaratives < Base
11
11
  end
12
12
  end
13
13
  end
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '2.0.35'
6
+ VERSION = '2.0.36'
7
7
  end
data.tar.gz.sig CHANGED
Binary file
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: 2.0.35
4
+ version: 2.0.36
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-03-13 00:00:00.000000000 Z
38
+ date: 2023-03-17 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: karafka-core
@@ -306,14 +306,14 @@ files:
306
306
  - lib/karafka/routing/features/dead_letter_queue/config.rb
307
307
  - lib/karafka/routing/features/dead_letter_queue/contract.rb
308
308
  - lib/karafka/routing/features/dead_letter_queue/topic.rb
309
+ - lib/karafka/routing/features/declaratives.rb
310
+ - lib/karafka/routing/features/declaratives/config.rb
311
+ - lib/karafka/routing/features/declaratives/contract.rb
312
+ - lib/karafka/routing/features/declaratives/topic.rb
309
313
  - lib/karafka/routing/features/manual_offset_management.rb
310
314
  - lib/karafka/routing/features/manual_offset_management/config.rb
311
315
  - lib/karafka/routing/features/manual_offset_management/contract.rb
312
316
  - lib/karafka/routing/features/manual_offset_management/topic.rb
313
- - lib/karafka/routing/features/structurable.rb
314
- - lib/karafka/routing/features/structurable/config.rb
315
- - lib/karafka/routing/features/structurable/contract.rb
316
- - lib/karafka/routing/features/structurable/topic.rb
317
317
  - lib/karafka/routing/proxy.rb
318
318
  - lib/karafka/routing/router.rb
319
319
  - lib/karafka/routing/subscription_group.rb
metadata.gz.sig CHANGED
Binary file