Class: Kafka::Consumer::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/kafka/consumer/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topic, partition, fetched_message) ⇒ Message

Returns a new instance of Message.



6
7
8
9
# File 'lib/kafka/consumer/message.rb', line 6

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

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



4
5
6
# File 'lib/kafka/consumer/message.rb', line 4

def key
  @key
end

#offsetObject (readonly)

Returns the value of attribute offset.



4
5
6
# File 'lib/kafka/consumer/message.rb', line 4

def offset
  @offset
end

#partitionObject (readonly)

Returns the value of attribute partition.



4
5
6
# File 'lib/kafka/consumer/message.rb', line 4

def partition
  @partition
end

#topicObject (readonly)

Returns the value of attribute topic.



4
5
6
# File 'lib/kafka/consumer/message.rb', line 4

def topic
  @topic
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/kafka/consumer/message.rb', line 4

def value
  @value
end