Class: NulogyMessageBusConsumer::Steps::StreamMessages
- Inherits:
-
Object
- Object
- NulogyMessageBusConsumer::Steps::StreamMessages
- Defined in:
- lib/nulogy_message_bus_consumer/steps/stream_messages.rb
Instance Method Summary collapse
- #call(kafka_consumer:, **_) ⇒ Object
-
#initialize(logger) ⇒ StreamMessages
constructor
A new instance of StreamMessages.
Constructor Details
#initialize(logger) ⇒ StreamMessages
Returns a new instance of StreamMessages.
4 5 6 |
# File 'lib/nulogy_message_bus_consumer/steps/stream_messages.rb', line 4 def initialize(logger) @logger = logger end |
Instance Method Details
#call(kafka_consumer:, **_) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/nulogy_message_bus_consumer/steps/stream_messages.rb', line 8 def call(kafka_consumer:, **_) kafka_consumer.each do || yield( message: Message.from_kafka(), kafka_message: ) end rescue => e @logger.error(JSON.dump({ event: "message_processing_errored", class: e.class, message: e. })) raise end |