deimos-ruby 2.0.0.pre.alpha6 → 2.0.0.pre.beta1

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: b6318df2cd977604adf4ca47936a32963f388b53ba2dbd493f93b75f43bdb451
4
- data.tar.gz: b7f506393529e41a6e2df0f3bf4b7e4162bdf1b79a51e04a261e664c3ea26c3f
3
+ metadata.gz: f5a771b9dee159bd0827bd8d3068cec505e8494e9b57a4e9c3038d0d48309dfc
4
+ data.tar.gz: 82cb497cc46f8cd3812399a36fd3520b7d7716c1f389d6474dac76326b5761be
5
5
  SHA512:
6
- metadata.gz: 4e899c5e27829e78cb61fb51b1d7de28330109969e6f37555f9b591bee17b7da6f49496384bce87a960c005d24c44925f52ba3e4a281bad9c9bd6563f594472d
7
- data.tar.gz: 718ba56a1c9a1c2ec1ce681e751b6fa0258c85f95debca251cb6c2854f220500bb3e1fa053cf9203153203c96a8f94a9ed087b022147da08fc8b0e18d0f3150d
6
+ metadata.gz: 3a2ddfdae480ed35c08815d65d708e468e201c7421f9edca36c5df8c725c69821d4a2978c80544028539926fc24e52045a2eda67cafb19458798dadf91cb9c71
7
+ data.tar.gz: f8cbd6e123c31a69198fd4c20d2adbda9527258fa35048e15660604cf4aaecd607adfb639ad91d3d6e5b19784555e4096bbd388d2dad33b349b1f9ca4d79af2e
@@ -10,7 +10,7 @@ module Deimos
10
10
  message: message
11
11
  ) do
12
12
  config = Deimos.karafka_config_for(topic: message[:topic])
13
- return message if config.nil?
13
+ return message if config.nil? || config.schema.nil?
14
14
  return if message[:payload] && !message[:payload].is_a?(Hash) && !message[:payload].is_a?(SchemaClass::Record)
15
15
 
16
16
  m = Deimos::Message.new(message[:payload].to_h,
@@ -14,7 +14,7 @@ class Matcher
14
14
  def replay_on(topic_node)
15
15
  @applications.each do |method, kwargs|
16
16
  if method == :kafka
17
- topic_node.kafka = kwargs
17
+ topic_node.kafka = kwargs.is_a?(Array) ? kwargs[0] : kwargs
18
18
  next
19
19
  end
20
20
  if kwargs.is_a?(Hash)
@@ -42,7 +42,12 @@ module Deimos
42
42
  case payload_log
43
43
  when :keys
44
44
  keys = messages.map do |m|
45
- m.respond_to?(:payload) ? m.key || m.payload['message_id'] : m[:key] || m[:payload_key] || m[:payload]['message_id']
45
+ if m.respond_to?(:payload)
46
+ m.key || m.payload['message_id']
47
+ elsif m
48
+ payload = m[:payload]&.with_indifferent_access
49
+ m[:key] || m[:payload_key] || payload[:payload_key] || payload[:message_id]
50
+ end
46
51
  end
47
52
  log_message.merge!(
48
53
  payload_keys: keys
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '2.0.0-alpha6'
4
+ VERSION = '2.0.0-beta1'
5
5
  end
data/lib/deimos.rb CHANGED
@@ -139,6 +139,9 @@ module Deimos
139
139
 
140
140
  def setup_karafka
141
141
  Karafka.producer.middleware.append(Deimos::ProducerMiddleware)
142
+ # for multiple setup calls
143
+ Karafka.producer.config.kafka =
144
+ Karafka::Setup::AttributesMap.producer(Karafka::Setup::Config.config.kafka.dup)
142
145
  EVENT_TYPES.each { |type| Karafka.monitor.notifications_bus.register_event(type) }
143
146
 
144
147
  Karafka.producer.monitor.subscribe('error.occurred') do |event|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deimos-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha6
4
+ version: 2.0.0.pre.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-11 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro_turf