deimos-ruby 2.1.11 → 2.1.12
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 +4 -0
- data/lib/deimos/transcoder.rb +1 -1
- data/lib/deimos/version.rb +1 -1
- data/spec/consumer_spec.rb +18 -0
- 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: 5a9c5468548c64f31b8c85c00437e252ba37c5771afcc5b1c7bde0d90d22d7b9
|
4
|
+
data.tar.gz: e4fe9d8ccaf829861abae9715be7169ffa4fbcbad0a6e475442837ef37e4ea82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a61436faff53a8d5c5acd6bc928992ebfcc45490a437d21de44d8035da6ad758a5e19bce4da57f663b2a8056cc01b6af02a7b502b57e3f6eff498665cd4e6db1
|
7
|
+
data.tar.gz: cb89fdaf41772e3160d9dd9e782d256dac72fab5af817e9d755d6f1cbb727af1c32ad3ad0eb0e429213096c72b6571dea42ff10bc7bcc116170a9e0c5fd536e3
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## UNRELEASED
|
9
9
|
|
10
|
+
# 2.1.12 - 2025-10-03
|
11
|
+
|
12
|
+
- Fix: Fixes a crash when schema classes are in use and key config is set to `:plain`.
|
13
|
+
|
10
14
|
# 2.1.11 - 2025-09-19
|
11
15
|
|
12
16
|
- Fix: KafkaSource was broken when used with a non-ActiveRecordProducer.
|
data/lib/deimos/transcoder.rb
CHANGED
@@ -53,7 +53,7 @@ module Deimos
|
|
53
53
|
return nil if payload.nil?
|
54
54
|
|
55
55
|
decoded_payload = self.backend.decode(payload)
|
56
|
-
return decoded_payload
|
56
|
+
return decoded_payload if !@use_schema_classes || !decoded_payload.is_a?(Hash)
|
57
57
|
|
58
58
|
Utils::SchemaClass.instance(decoded_payload,
|
59
59
|
@schema,
|
data/lib/deimos/version.rb
CHANGED
data/spec/consumer_spec.rb
CHANGED
@@ -20,6 +20,7 @@ module ConsumerTest
|
|
20
20
|
# :nodoc:
|
21
21
|
def consume_message(message)
|
22
22
|
message.payload
|
23
|
+
message.key
|
23
24
|
end
|
24
25
|
end
|
25
26
|
stub_const('ConsumerTest::MyConsumer', consumer_class)
|
@@ -82,6 +83,23 @@ module ConsumerTest
|
|
82
83
|
to raise_error(Avro::SchemaValidator::ValidationError)
|
83
84
|
end
|
84
85
|
|
86
|
+
it 'should work if schema is set to string' do
|
87
|
+
Karafka::App.routes.redraw do
|
88
|
+
topic 'my_consume_topic' do
|
89
|
+
schema 'MySchema'
|
90
|
+
namespace 'com.my-namespace'
|
91
|
+
key_config plain: true
|
92
|
+
consumer MyConsumer
|
93
|
+
reraise_errors true
|
94
|
+
use_schema_classes use_schema_classes
|
95
|
+
reraise_errors true
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
test_consume_message(MyConsumer, { 'test_id' => 'foo',
|
100
|
+
'some_int' => 123 }, key: 'a key')
|
101
|
+
end
|
102
|
+
|
85
103
|
it 'should fail if reraise is false but fatal_error is true' do
|
86
104
|
expect { test_consume_message(MyConsumer, {test_id: 'fatal'}) }.
|
87
105
|
to raise_error(Avro::SchemaValidator::ValidationError)
|