rimless 1.7.7 → 1.8.0

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: 65a81e9d34d669a1e6acd791e2c10a189869fc40d2910b478fa37fac6c84accb
4
- data.tar.gz: 69a88291a2aef544f0d646e58951f7fc9dc143848b9cc05041cfd19a8e19d47a
3
+ metadata.gz: a1deea4fa3747418c007acbf6eadb5634b97f3e5fc3ec221a78d6cf4f8c10d42
4
+ data.tar.gz: 939c0455cc813c211a2f934ee0cad879d06bc28faef5d03ab5ca7906bf5c015e
5
5
  SHA512:
6
- metadata.gz: 427e0d60a2aae434d3742ab73ae676917077c16216282d6de286c3f32cc5a4c2df02034ff743b8acb1470f2d347d710d0bac322c264f64ddbdda5ad1526a7667
7
- data.tar.gz: 7f1bd3ff9c139586dd4b4c14efdd80177860e3d4e7d2dc93e58a29ed2fed67985218031fb3264b103efe2bac209fb3f02a2c9a1495f23d81e66384112d0209bb
6
+ metadata.gz: e73bffa03e3c7f5b1635ae1eeb79cc7de8748e841d7d7aa027def3b9ef62b3e068cd04c04349cf498cc55b94d13d5a7538be5c7c599707c72526c72d94a716bd
7
+ data.tar.gz: b33dd85d1d5a915483de9b2836f184ad17e4cfb180902b53e41a14ee1283683d8f7838acd51326a68758663ea27bdfc9e419b5a461d40f75758ef035911da776
data/CHANGELOG.md CHANGED
@@ -2,41 +2,48 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
- ### 1.7.7
5
+ ### 1.8.0 (14 November 2024)
6
+
7
+ * Added support for custom topic names via the `full_name:` keyword argument on
8
+ the consumer routing table (#44)
9
+ * Added support to pass a block to the routing table
10
+ (`Rimless.consumer.topics`) to add custom topic configurations (#44)
11
+
12
+ ### 1.7.7 (19 September 2024)
6
13
 
7
14
  * Corrected the Sidekiq interchanger decoding, which is caused by an upstream
8
15
  update of the karafka-sidekiq-backend gem (#43)
9
16
 
10
- ### 1.7.6
17
+ ### 1.7.6 (19 September 2024)
11
18
 
12
19
  * Added a monkey-patch for the constellation Karafka 1.4 and Thor 1.3,
13
20
  on Ruby >=2.7 (#42)
14
21
 
15
- ### 1.7.5
22
+ ### 1.7.5 (15 August 2024)
16
23
 
17
24
  * Just a retag of 1.7.1
18
25
 
19
- ### 1.7.4
26
+ ### 1.7.4 (15 August 2024)
20
27
 
21
28
  * Just a retag of 1.7.1
22
29
 
23
- ### 1.7.3
30
+ ### 1.7.3 (15 August 2024)
24
31
 
25
32
  * Just a retag of 1.7.1
26
33
 
27
- ### 1.7.2
34
+ ### 1.7.2 (9 August 2024)
28
35
 
29
36
  * Just a retag of 1.7.1
30
37
 
31
- ### 1.7.1
38
+ ### 1.7.1 (9 August 2024)
32
39
 
33
40
  * Added API docs building to continuous integration (#41)
34
41
 
35
- ### 1.7.0
42
+ ### 1.7.0 (8 July 2024)
36
43
 
37
44
  * Added CI tests for Rails 6.1 and 7.1 (#39)
38
45
 
39
- ### 1.6.0
46
+ ### 1.6.0 (3 July 2024)
40
47
 
41
48
  * Dropped support for Ruby <2.7 (#38)
42
49
  * Moved the schema file validation into the retry block for parallel execution
@@ -44,34 +51,34 @@
44
51
  * Updated the [Kafka Playground](./doc/kafka-playground) to the latest
45
52
  Apache Kafka (3.7) and Schema Registry (7.6) versions (#35)
46
53
 
47
- ### 1.5.1
54
+ ### 1.5.1 (26 April 2024)
48
55
 
49
56
  * Added a retry to write compiled schema files as this may fail on parallel
50
57
  execution (#33)
51
58
 
52
- ### 1.5.0
59
+ ### 1.5.0 (4 December 2023)
53
60
 
54
61
  * Do not extend the `Rimless.logger` to write to stdout by default when running
55
62
  in the `development` environment - this generates duplicated messages when
56
63
  the configured logger already writes to stdout. A new configuration was added
57
64
  `Rimless.configuration.extend_dev_logger = false` was added (#32)
58
65
 
59
- ### 1.4.2
66
+ ### 1.4.2 (12 July 2023)
60
67
 
61
68
  * Reverted to use `yield_self` instead of `then` in order to support Ruby 2.5
62
69
  as advertised (broken since #19, 1.3.0) (#31)
63
70
 
64
- ### 1.4.1
71
+ ### 1.4.1 (5 July 2023)
65
72
 
66
73
  * Moved the development dependencies from the gemspec to the Gemfile (#29)
67
74
  * Pinned Karafka gem <1.4.15 in order to suppress the
68
75
  `I_ACCEPT_CRITICAL_ERRORS_IN_KARAFKA_1_4=true` agony (#30)
69
76
 
70
- ### 1.4.0
77
+ ### 1.4.0 (24 February 2023)
71
78
 
72
79
  * Added support for Gem release automation
73
80
 
74
- ### 1.3.0
81
+ ### 1.3.0 (18 January 2023)
75
82
 
76
83
  * Bundler >= 2.3 is from now on required as minimal version (#19)
77
84
  * Dropped support for Ruby < 2.5 (#19)
@@ -79,49 +86,49 @@
79
86
  * Updated all development/runtime gems to their latest
80
87
  Ruby 2.5 compatible version (#19)
81
88
 
82
- ### 1.2.0
89
+ ### 1.2.0 (4 October 2021)
83
90
 
84
91
  * Added a `capture_kafka_messages` helper for RSpec (#12)
85
92
 
86
- ### 1.1.1
93
+ ### 1.1.1 (12 May 2021)
87
94
 
88
95
  * Corrected the GNU Make release target
89
96
 
90
- ### 1.1.0
97
+ ### 1.1.0 (23 October 2020)
91
98
 
92
99
  * Added support for Karafka `~> 1.4.0` and set is as minimum dependency version
93
100
  (#10)
94
101
 
95
- ### 1.0.4
102
+ ### 1.0.4 (14 August 2020)
96
103
 
97
104
  * Mocked WaterDrop producers in the rimless rspec helper so that tests
98
105
  won't actually talk to Kafka (#9)
99
106
 
100
- ### 1.0.3
107
+ ### 1.0.3 (14 May 2020)
101
108
 
102
109
  * Corrected broken stats when no consumer is yet defined (#8)
103
110
 
104
- ### 1.0.2
111
+ ### 1.0.2 (11 March 2020)
105
112
 
106
113
  * Only load the statistics rake task when Rails is available and the
107
114
  environment is development (instead of not production, this may cause issues
108
115
  for +canary+ or +stage+ Rails environments)
109
116
 
110
- ### 1.0.1
117
+ ### 1.0.1 (11 March 2020)
111
118
 
112
119
  * Added the missing +Karafka::Testing::RSpec::Helpers+ include to the
113
120
  RSpec configuration
114
121
 
115
- ### 1.0.0
122
+ ### 1.0.0 (11 March 2020)
116
123
 
117
124
  * Dropped support for Ruby 2.3/2.4 and added support for Rails 6.0 (#6)
118
125
  * Implemented a simple opinionated Kafka consumer setup (#7)
119
126
 
120
- ### 0.3.0
127
+ ### 0.3.0 (8 November 2019)
121
128
 
122
129
  * Upgraded the avro_turf gem (`~> 0.11.0`) (#5)
123
130
 
124
- ### 0.2.1
131
+ ### 0.2.1 (13 August 2019)
125
132
 
126
133
  * Added support for the
127
134
  [parallel_tests](https://github.com/grosser/parallel_tests) gem and
@@ -129,7 +136,7 @@
129
136
  thread. This fixes all race conditions which slow down or break user test
130
137
  suites.
131
138
 
132
- ### 0.2.0
139
+ ### 0.2.0 (5 June 2019)
133
140
 
134
141
  * Added the `Rimless.encode` (`.avro_encode`) and `Rimless.decode`
135
142
  (`.avro_decode`) helpers/shortcuts to simplify the interaction with the
@@ -148,29 +155,29 @@
148
155
  of the compiled schema directory caused previously file read errors when a
149
156
  parallel process started a recompilation.
150
157
 
151
- ### 0.1.4
158
+ ### 0.1.4 (17 April 2019)
152
159
 
153
160
  * Reconfigure (reset) the AvroTurf instance on tests to avoid caching issues
154
161
  (on failed tests the message decoding was not working which results in
155
162
  unrelated errors, instead of showing the actual test failure)
156
163
 
157
- ### 0.1.3
164
+ ### 0.1.3 (16 April 2019)
158
165
 
159
166
  * Check for unset and empty values while configuring dependencies
160
167
 
161
- ### 0.1.2
168
+ ### 0.1.2 (16 April 2019)
162
169
 
163
170
  * Skip the configuration of the AvroTurf gem in case no schema registry URL is
164
171
  configured, this allows the smooth run of Rails asset precompilations without
165
172
  full environment configurations (eg. on CI)
166
173
 
167
- ### 0.1.1
174
+ ### 0.1.1 (16 April 2019)
168
175
 
169
176
  * Skip the configuration of the WaterDrop gem in case no brokers are
170
177
  configured, this allows the smooth run of Rails asset precompilations without
171
178
  full environment configurations (eg. on CI)
172
179
 
173
- ### 0.1.0
180
+ ### 0.1.0 (16 April 2019)
174
181
 
175
182
  * The first release with support for simple Apache Avro message producing on
176
183
  Apache Kafka/Confluent Schema Registry
@@ -126,12 +126,23 @@ module Rimless
126
126
  # topics({ app: :test_app, name: :admins } => YourConsumer)
127
127
  # topics({ app: :test_app, names: %i[users admins] } => YourConsumer)
128
128
  #
129
+ # Examples:
130
+ #
131
+ # topics do
132
+ # topic('name') do
133
+ # consumer CustomConsumer
134
+ # end
135
+ # end
136
+ #
129
137
  # @param topics [Hash{Hash => Class}] the topic to consumer mapping
138
+ # @yield the given block on the routing table
130
139
  #
131
140
  # rubocop:disable Metrics/MethodLength because of the Karafka DSL
132
- def topics(topics)
141
+ def topics(topics = [], &block)
133
142
  consumer_groups.draw do
134
- consumer_group Rimless.configuration.client_id do
143
+ consumer_group(Rimless.configuration.client_id) do
144
+ instance_exec(&block) if block_given?
145
+
135
146
  topics.each do |topic_parts, dest_consumer|
136
147
  Rimless.consumer.topic_names(topic_parts).each do |topic_name|
137
148
  topic(topic_name) do
@@ -19,14 +19,21 @@ module Rimless
19
19
  # Rimless.topic(:users, app: 'test-api')
20
20
  # @example Mix and match
21
21
  # Rimless.topic(name: 'test', app: :fancy_app)
22
+ # @example Full name - use as is
23
+ # Rimless.topic(full_name: 'my.custom.topic.name')
22
24
  #
23
- # rubocop:disable Metrics/AbcSize because of the usage flexibility
25
+ # rubocop:disable Metrics/MethodLength because of the usage flexibility
26
+ # rubocop:disable Metrics/AbcSize dito
24
27
  # rubocop:disable Metrics/CyclomaticComplexity dito
28
+ # rubocop:disable Metrics/PerceivedComplexity dito
25
29
  def topic(*args)
26
30
  opts = args.last
27
31
  name = args.first if [String, Symbol].member?(args.first.class)
28
32
 
29
33
  if opts.is_a?(Hash)
34
+ # When we got a full name, we use it as is
35
+ return opts[:full_name] if opts.key? :full_name
36
+
30
37
  name = opts[:name] if opts.key?(:name)
31
38
  app = opts[:app] if opts.key?(:app)
32
39
  end
@@ -38,8 +45,10 @@ module Rimless
38
45
 
39
46
  "#{Rimless.topic_prefix(app)}#{name}".tr('_', '-')
40
47
  end
48
+ # rubocop:enable Metrics/MethodLength
41
49
  # rubocop:enable Metrics/AbcSize
42
50
  # rubocop:enable Metrics/CyclomaticComplexity
51
+ # rubocop:enable Metrics/PerceivedComplexity
43
52
 
44
53
  # Send a single message to Apache Kafka. The data is encoded according to
45
54
  # the given Apache Avro schema. The destination Kafka topic may be a
@@ -3,7 +3,7 @@
3
3
  # The gem version details.
4
4
  module Rimless
5
5
  # The version of the +rimless+ gem
6
- VERSION = '1.7.7'
6
+ VERSION = '1.8.0'
7
7
 
8
8
  class << self
9
9
  # Returns the version of gem as a string.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rimless
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.7
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-19 00:00:00.000000000 Z
11
+ date: 2024-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport