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) ⇒ void

This method returns an undefined value.

Parameters:



52
53
54
# File 'lib/deimos/utils/inline_consumer.rb', line 52

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

.start(_kafka_client) ⇒ void

This method returns an undefined value.

Parameters:

  • _kafka_client (Kafka::Client)


58
59
60
# File 'lib/deimos/utils/inline_consumer.rb', line 58

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

Instance Method Details

#consume(payload, metadata) ⇒ Object

Parameters:

  • payload (Hash)
  • metadata (Hash)


64
65
66
67
68
69
# File 'lib/deimos/utils/inline_consumer.rb', line 64

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