rimless 3.1.0 → 3.3.0
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 +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +7 -7
- data/UPGRADING.md +27 -0
- data/lib/rimless/configuration.rb +5 -0
- data/lib/rimless/consumer/app.rb +5 -0
- data/lib/rimless/consumer/avro_deserializer.rb +36 -0
- data/lib/rimless/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b258d50dc6020e58639709dda7cc93bcc0deaf96d53defd689bcc10ae270041
|
|
4
|
+
data.tar.gz: 82f0ef8f8bed2b01f4fc2577c7a1ca84b13da5526420f264f5d13cbb9afd7af8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad93ec539b08cfa0b34daf4cb426a2da1c6c781fa0779e256600a60420536239b83d194ff5a58cfce8f066a4fe644869367bd510c710f86ce8be62fec2e43776
|
|
7
|
+
data.tar.gz: 1ce1a114e929c2b5fb219343bd42dd44efccd3aa893b9de96445876c94a0f9eb6c80e3aa133e7cf6d1e3b4bb1c710297ad5f12cb313146ad654d23a404d9c8fa
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
* TODO: Replace this bullet point with an actual description of a change.
|
|
4
4
|
|
|
5
|
+
### 3.3.0 (16 April 2026)
|
|
6
|
+
|
|
7
|
+
* Added a new configuration (`avro_deserializer_parse_datetimes`) which allows
|
|
8
|
+
to configure the default Apache Avro deserializer to automatically parse
|
|
9
|
+
date/time/datetime's from deeply nested strings (disabled by default for
|
|
10
|
+
compatibility) ([#76](https://github.com/hausgold/rimless/pull/76))
|
|
11
|
+
|
|
12
|
+
### 3.2.0 (7 April 2026)
|
|
13
|
+
|
|
14
|
+
* Restored non-buffered (`$stdout.sync = true`) logging to stdout ([#75](https://github.com/hausgold/rimless/pull/75))
|
|
15
|
+
* Added a section for topic auto-creation on the upgrading guide ([#75](https://github.com/hausgold/rimless/pull/75))
|
|
16
|
+
|
|
5
17
|
### 3.1.0 (1 April 2026)
|
|
6
18
|
|
|
7
19
|
* Updated the kafka-playground ([#74](https://github.com/hausgold/rimless/pull/74))
|
data/README.md
CHANGED
|
@@ -322,13 +322,13 @@ architecture looks like this:
|
|
|
322
322
|
|
|
|
323
323
|
v
|
|
324
324
|
+-----------------------------+
|
|
325
|
-
| Karafka/Rimless Consumer |
|
|
326
|
-
| Shares a single consumer |--->| ActiveJob
|
|
327
|
-
| group, multiple processes | | Runs the consumer class (children
|
|
328
|
-
+-----------------------------+ | of Rimless::
|
|
329
|
-
| message (Rimless::
|
|
330
|
-
| one message per job
|
|
331
|
-
|
|
325
|
+
| Karafka/Rimless Consumer | +----------------------------------------+
|
|
326
|
+
| Shares a single consumer |--->| ActiveJob |
|
|
327
|
+
| group, multiple processes | | Runs the consumer class (children |
|
|
328
|
+
+-----------------------------+ | of Rimless::Consumer::Base) for each |
|
|
329
|
+
| message (Rimless::Consumer::Job), |
|
|
330
|
+
| one message per job |
|
|
331
|
+
+----------------------------------------+
|
|
332
332
|
```
|
|
333
333
|
|
|
334
334
|
This architecture allows the consumer process to run mostly non-blocking and
|
data/UPGRADING.md
CHANGED
|
@@ -16,6 +16,7 @@ upgrading from Rimless 2.9.x to 3.0.
|
|
|
16
16
|
- [Offset Management](#offset-management)
|
|
17
17
|
- [Railtie / Sidekiq Server Initialization](#railtie--sidekiq-server-initialization)
|
|
18
18
|
- [Anonymous Consumer Classes](#anonymous-consumer-classes)
|
|
19
|
+
- [Topic Auto-Creation](#topic-auto-creation)
|
|
19
20
|
- [Producer Changes](#producer-changes)
|
|
20
21
|
- [Testing Changes](#testing-changes)
|
|
21
22
|
- [Consumer Specs](#consumer-specs)
|
|
@@ -341,6 +342,32 @@ Rimless.consumer.topics(
|
|
|
341
342
|
The `JobBridge.build` method will raise an `ArgumentError` if an anonymous
|
|
342
343
|
class is passed.
|
|
343
344
|
|
|
345
|
+
### Topic Auto-Creation
|
|
346
|
+
|
|
347
|
+
Karafka 2 **no longer automatically creates missing topics**. If your
|
|
348
|
+
application relied on Karafka 1's default behavior of creating topics on the
|
|
349
|
+
fly (within the Karafka server/consumer process), you will encounter errors
|
|
350
|
+
like:
|
|
351
|
+
|
|
352
|
+
```
|
|
353
|
+
[ERROR] Data polling error occurred: Subscribed topic not available:
|
|
354
|
+
production.users-api.properties: Broker: Unknown topic or partition -
|
|
355
|
+
Broker: Unknown topic or partition (unknown_topic_or_part)
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Karafka 2 recommends using **Declarative Topics** to manage your topic
|
|
359
|
+
infrastructure. Define your topics in the routing configuration and then run:
|
|
360
|
+
|
|
361
|
+
```shell
|
|
362
|
+
$ karafka topics migrate
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
This will create or update topics to match your declared configuration.
|
|
366
|
+
|
|
367
|
+
See:
|
|
368
|
+
- [Infrastructure Topic Auto-Creation](https://karafka.io/docs/Infrastructure-Topic-Auto-Creation/)
|
|
369
|
+
- [Infrastructure Declarative Topics](https://karafka.io/docs/Infrastructure-Declarative-Topics/)
|
|
370
|
+
|
|
344
371
|
## Producer Changes
|
|
345
372
|
|
|
346
373
|
The public producer API (`Rimless.message`, `Rimless.async_message`,
|
|
@@ -134,6 +134,11 @@ module Rimless
|
|
|
134
134
|
Rimless::Consumer::AvroDeserializer
|
|
135
135
|
end
|
|
136
136
|
|
|
137
|
+
# This configuration allows to configure the default Apache Avro
|
|
138
|
+
# deserializer to automatically parse date/time/datetime's from deeply
|
|
139
|
+
# nested strings.
|
|
140
|
+
config_accessor(:avro_deserializer_parse_datetimes) { false }
|
|
141
|
+
|
|
137
142
|
# The ActiveJob job queue to use for consuming jobs
|
|
138
143
|
config_accessor(:consumer_job_queue) do
|
|
139
144
|
ENV.fetch(
|
data/lib/rimless/consumer/app.rb
CHANGED
|
@@ -81,6 +81,11 @@ module Rimless
|
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
# We configure synchronous logging to stdout as supervising/monitoring
|
|
85
|
+
# processes await logging outputs to detect the Karafka server process
|
|
86
|
+
# is up and running properly
|
|
87
|
+
$stdout.sync = true
|
|
88
|
+
|
|
84
89
|
# Call the user-configurable block with our configuration
|
|
85
90
|
# for customizations
|
|
86
91
|
setup(&Rimless.configuration.consumer_configure)
|
|
@@ -4,6 +4,12 @@ module Rimless
|
|
|
4
4
|
module Consumer
|
|
5
5
|
# A custom Apache Avro compatible message deserializer.
|
|
6
6
|
class AvroDeserializer
|
|
7
|
+
# The ISO8601 date/time format
|
|
8
|
+
ISO_TIME_FORMAT = /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?/m
|
|
9
|
+
|
|
10
|
+
# The ISO8601 date format
|
|
11
|
+
ISO_DATE_FORMAT = /\A\d{4}-\d{2}-\d{2}\Z/m
|
|
12
|
+
|
|
7
13
|
# Deserialize an Apache Avro encoded Apache Kafka message.
|
|
8
14
|
#
|
|
9
15
|
# @param message [Karafka::Messages::Message] the Karafka message to
|
|
@@ -25,6 +31,36 @@ module Rimless
|
|
|
25
31
|
.then { |data| data.transform_keys { |key| key.delete('\\') } }
|
|
26
32
|
.then { |data| Unsparsify(data, sparse_array: true) }
|
|
27
33
|
.deep_symbolize_keys
|
|
34
|
+
.then do |obj|
|
|
35
|
+
# When the configuration says we should not parse datetimes,
|
|
36
|
+
# we skip further processing
|
|
37
|
+
next obj \
|
|
38
|
+
unless Rimless.configuration.avro_deserializer_parse_datetimes
|
|
39
|
+
|
|
40
|
+
# Otherwise we parse them
|
|
41
|
+
parse_timestamps!(obj)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Search recursively through the given object for ISO date/time string
|
|
46
|
+
# values and replace them with their parsed date representation. This
|
|
47
|
+
# works on hashes, arrays, and combinations of this.
|
|
48
|
+
#
|
|
49
|
+
# @param value [Mixed] the input to process
|
|
50
|
+
# @return [Mixed] the processed input
|
|
51
|
+
def parse_timestamps!(obj)
|
|
52
|
+
case obj
|
|
53
|
+
when Hash
|
|
54
|
+
obj.each { |key, val| obj[key] = parse_timestamps!(val) }
|
|
55
|
+
when Array
|
|
56
|
+
obj.each_with_index { |cur, idx| obj[idx] = parse_timestamps!(cur) }
|
|
57
|
+
when ISO_TIME_FORMAT
|
|
58
|
+
Time.zone.parse(obj)
|
|
59
|
+
when ISO_DATE_FORMAT
|
|
60
|
+
Date.parse(obj)
|
|
61
|
+
else
|
|
62
|
+
obj
|
|
63
|
+
end
|
|
28
64
|
end
|
|
29
65
|
end
|
|
30
66
|
end
|
data/lib/rimless/version.rb
CHANGED