Class: NulogyMessageBusConsumer::Handlers::LogUnprocessedMessages
- Inherits:
-
Object
- Object
- NulogyMessageBusConsumer::Handlers::LogUnprocessedMessages
- Defined in:
- lib/nulogy_message_bus_consumer/handlers/log_unprocessed_messages.rb
Instance Method Summary collapse
- #call(message:, **_) ⇒ Object
-
#initialize(logger) ⇒ LogUnprocessedMessages
constructor
A new instance of LogUnprocessedMessages.
Constructor Details
#initialize(logger) ⇒ LogUnprocessedMessages
Returns a new instance of LogUnprocessedMessages.
4 5 6 |
# File 'lib/nulogy_message_bus_consumer/handlers/log_unprocessed_messages.rb', line 4 def initialize(logger) @logger = logger end |
Instance Method Details
#call(message:, **_) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/nulogy_message_bus_consumer/handlers/log_unprocessed_messages.rb', line 8 def call(message:, **_) return if ProcessedMessage.exists?(id: .id) @logger.warn(JSON.dump( event: "unprocessed_message", kafka_message: .to_h )) end |