deimos-ruby 2.1.10 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4298f86cb3eb5cb847e29361a4f6a33f5db7492832c730155956c1099f26006b
4
- data.tar.gz: fe50a1133a94f9263758ba29198bbdccb83e35ccb45aee27107374f0141c26ba
3
+ metadata.gz: 5a9c5468548c64f31b8c85c00437e252ba37c5771afcc5b1c7bde0d90d22d7b9
4
+ data.tar.gz: e4fe9d8ccaf829861abae9715be7169ffa4fbcbad0a6e475442837ef37e4ea82
5
5
  SHA512:
6
- metadata.gz: d80a71f983e026f703b616d7206320922a22c471fb16d9c364b3fb24a826156eee8ab022666138e4b287f7a153e2abf4079ff58b758e98805902fc3cf34d2a49
7
- data.tar.gz: 51d3ba78308dfc330a01a0cc53c3105c70afe1c3f2ba812ec70902661be7bf5f381681135ff4909be9b3b153432553aa8a8bb8f11d605bd63308163a407f1e92
6
+ metadata.gz: a61436faff53a8d5c5acd6bc928992ebfcc45490a437d21de44d8035da6ad758a5e19bce4da57f663b2a8056cc01b6af02a7b502b57e3f6eff498665cd4e6db1
7
+ data.tar.gz: cb89fdaf41772e3160d9dd9e782d256dac72fab5af817e9d755d6f1cbb727af1c32ad3ad0eb0e429213096c72b6571dea42ff10bc7bcc116170a9e0c5fd536e3
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ 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
+
14
+ # 2.1.11 - 2025-09-19
15
+
16
+ - Fix: KafkaSource was broken when used with a non-ActiveRecordProducer.
17
+
10
18
  # 2.1.10 - 2025-09-19
11
19
 
12
20
  - Feature: Added `delete_record?` method to ActiveRecordConsumer to allow inspection of the payload to decide whether to delete, instead of hardcoding it to only delete on a null payload.
@@ -50,7 +50,10 @@ module Deimos
50
50
  return unless self.class.kafka_config[:delete]
51
51
 
52
52
  self.class.kafka_producers.each do |p|
53
- p.publish_list([p.generate_deletion_payload(self)])
53
+ generated = p.respond_to?(:generate_deletion_payload) ?
54
+ p.generate_deletion_payload(self) :
55
+ self.deletion_payload
56
+ p.publish_list([generated])
54
57
  end
55
58
  end
56
59
 
@@ -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 unless @use_schema_classes
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '2.1.10'
4
+ VERSION = '2.1.12'
5
5
  end
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deimos-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.10
4
+ version: 2.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner