Class: Kafka::FetchedMessage

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of FetchedMessage.


19
20
21
22
23
24
25
# File 'lib/kafka/fetched_message.rb', line 19

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

Instance Attribute Details

#keyString (readonly)

Returns the key of the message.

Returns:

  • (String)

    the key of the message.


8
9
10
# File 'lib/kafka/fetched_message.rb', line 8

def key
  @key
end

#offsetInteger (readonly)

Returns the offset of the message in the partition.

Returns:

  • (Integer)

    the offset of the message in the partition.


17
18
19
# File 'lib/kafka/fetched_message.rb', line 17

def offset
  @offset
end

#partitionInteger (readonly)

Returns the partition number that the message was written to.

Returns:

  • (Integer)

    the partition number that the message was written to.


14
15
16
# File 'lib/kafka/fetched_message.rb', line 14

def partition
  @partition
end

#topicString (readonly)

Returns the name of the topic that the message was written to.

Returns:

  • (String)

    the name of the topic that the message was written to.


11
12
13
# File 'lib/kafka/fetched_message.rb', line 11

def topic
  @topic
end

#valueString (readonly)

Returns the value of the message.

Returns:

  • (String)

    the value of the message.


5
6
7
# File 'lib/kafka/fetched_message.rb', line 5

def value
  @value
end