Class: Deimos::Utils::MessageBankHandler

Inherits:
Consumer
  • Object
show all
Includes:
Phobos::Handler
Defined in:
lib/deimos/utils/inline_consumer.rb

Overview

Class to return the messages consumed.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Consumer

#decode_key, #decode_message, decoder, key_decoder

Methods included from Consume::BatchConsumption

#around_consume_batch, #consume_batch

Methods included from Consume::MessageConsumption

#around_consume

Class Method Details

.config_class=(klass) ⇒ Object

Parameters:



49
50
51
# File 'lib/deimos/utils/inline_consumer.rb', line 49

def self.config_class=(klass)
  self.config.merge!(klass.config)
end

.start(_kafka_client) ⇒ Object

:nodoc:



54
55
56
# File 'lib/deimos/utils/inline_consumer.rb', line 54

def self.start(_kafka_client)
  self.total_messages = []
end

Instance Method Details

#consume(payload, metadata) ⇒ Object

:nodoc:



59
60
61
62
63
64
# File 'lib/deimos/utils/inline_consumer.rb', line 59

def consume(payload, )
  self.class.total_messages << {
    key: [:key],
    payload: payload
  }
end