Class: Poseidon::FetchedMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/poseidon/fetched_message.rb

Overview

A message fetched from a Kafka broker.

fetched_messages = consumer.fetch
fetched_messages.each do |fm|
  puts "Topic: #{fm.topic}"
  puts "Value #{fm.value}"
  puts "Key: #{fm.key}"
  puts "Offset: #{fm.offset}"
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topic, value, key, offset) ⇒ FetchedMessage

Returns a new instance of FetchedMessage.



30
31
32
33
34
35
# File 'lib/poseidon/fetched_message.rb', line 30

def initialize(topic, value, key, offset)
  @topic  = topic
  @value  = value
  @key    = key
  @offset = offset
end

Instance Attribute Details

#keyObject (readonly)



28
29
30
# File 'lib/poseidon/fetched_message.rb', line 28

def key
  @key
end

#offsetObject (readonly)



28
29
30
# File 'lib/poseidon/fetched_message.rb', line 28

def offset
  @offset
end

#topicObject (readonly)



28
29
30
# File 'lib/poseidon/fetched_message.rb', line 28

def topic
  @topic
end

#valueObject (readonly)



28
29
30
# File 'lib/poseidon/fetched_message.rb', line 28

def value
  @value
end