deimos-ruby 2.4.0.pre.beta20 → 2.4.0.pre.beta22

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: 98cbdce7153631edc65312a3a587fc8ac3e53883c495821c10741e727c275883
4
- data.tar.gz: 37bde7c252c79dae3010908b00fd9cbf82850decff2bc03afd33e291291169fe
3
+ metadata.gz: 28d698725082e6ddf9ae69668e2a30086c91b2f3684826127d8af32806a7d903
4
+ data.tar.gz: 63aa48456f8f9c5b6588e616eb382bae34975c43cb122b69b8845f1667c87083
5
5
  SHA512:
6
- metadata.gz: 3ba77e335cb5170a323e28921c539f0fa2edcbf58afb603f0501ca03fccf04ca8ca1fd1ab8ceb1eade765eaf0a9fe2e3447c2315afca7168933d58e0e158e627
7
- data.tar.gz: 671b92d6e2861b53e1d18bd931b42aec96b337fe94040cc20ab78866ac8dda30997fb95ffcacfa94a7cb0d5d81ce71f140a51dcf662b243ae327f10337a17e28
6
+ metadata.gz: e85bc10c0a70a1b254dc4df26d35f10a798575c980339416038fd1c1b4d6670faade53da1176d581c7627614bac2706485f25f984625d5c65c094d7731953851
7
+ data.tar.gz: 5fe362c6e616060fec466e00859dc36107bcff1ac94e4939b86209ff9a7d7df8f662e615755a7a41db7558cefaf5c4ff8e1162a21bf84673e7e5fa613c2a9cb3
data/CHANGELOG.md CHANGED
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
  - Add `registry_url`, `registry_user` and `registry_password` per-topic configuration.
12
12
  - Added `have_sent_including` RSpec matcher to allow for Protobuf messages that use default values to be checked.
13
13
 
14
+ # 2.3.5 - 2026-02-23
15
+
16
+ - Fix: Non-batch consumers should now support string table names.
17
+
14
18
  # 2.3.4 - 2026-02-21
15
19
 
16
20
  - Fix/feature: Send `consumer.lags` and `consumer.lags_delta` metrics via MinimalDatadogListener.
@@ -42,6 +42,7 @@ module Deimos
42
42
  end
43
43
 
44
44
  klass = self.class.config[:record_class]
45
+ klass = klass.constantize if klass.is_a?(String)
45
46
  payload = message.payload
46
47
  if payload.is_a?(Hash) || payload.nil?
47
48
  payload = payload.to_h.with_indifferent_access
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '2.4.0-beta20'
4
+ VERSION = '2.4.0-beta22'
5
5
  end
data/lib/deimos.rb CHANGED
@@ -203,7 +203,12 @@ module Deimos
203
203
  topic = event[:messages].first[:topic]
204
204
  config = Deimos.karafka_config_for(topic: topic)
205
205
  message = Deimos::Logging.messages_log_text(config&.payload_log, event[:messages])
206
- Karafka.logger.error("Error producing messages: #{event[:error].message} #{message.to_json}")
206
+ json = begin
207
+ message.to_json
208
+ rescue StandardError
209
+ message.to_s
210
+ end
211
+ Karafka.logger.error("Error producing messages: #{event[:error].message} #{json}")
207
212
  end
208
213
  end
209
214
  end
@@ -255,6 +255,29 @@ module ActiveRecordConsumerTest
255
255
  expect(Widget.find_by_test_id('id2').some_int).to eq(4)
256
256
  end
257
257
 
258
+ it 'should handle record_class as a string' do
259
+ consumer_class = Class.new(Deimos::ActiveRecordConsumer) do
260
+ record_class 'ActiveRecordConsumerTest::Widget'
261
+ end
262
+ stub_const('MyStringRecordClassConsumer', consumer_class)
263
+ Karafka::App.routes.redraw do
264
+ topic 'my-topic-string' do
265
+ consumer MyStringRecordClassConsumer
266
+ schema 'MySchema'
267
+ namespace 'com.my-namespace'
268
+ key_config plain: true
269
+ end
270
+ end
271
+
272
+ expect(Widget.count).to eq(0)
273
+ test_consume_message(MyStringRecordClassConsumer, {
274
+ test_id: 'abc',
275
+ some_int: 3
276
+ }, call_original: true, key: 5)
277
+ expect(Widget.count).to eq(1)
278
+ expect(Widget.last.test_id).to eq('abc')
279
+ end
280
+
258
281
  it 'should not create record of process_message returns false' do
259
282
  allow_any_instance_of(MyConsumer).to receive(:process_message?).and_return(false)
260
283
  expect(Widget.count).to eq(0)
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.4.0.pre.beta20
4
+ version: 2.4.0.pre.beta22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner