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(message:, topic:, partition:) ⇒ FetchedMessage

Returns a new instance of FetchedMessage.



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

def initialize(message:, topic:, partition:)
  @message = message
  @topic = topic
  @partition = partition
end

Instance Attribute Details

#partitionInteger (readonly)

Returns the partition number that the message was written to.

Returns:

  • (Integer)

    the partition number that the message was written to.



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

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.



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

def topic
  @topic
end

Instance Method Details

#create_timeTime

Returns the timestamp of the message.

Returns:

  • (Time)

    the timestamp of the message.



33
34
35
# File 'lib/kafka/fetched_message.rb', line 33

def create_time
  @message.create_time
end

#headersHash<String, String>

Returns the headers of the message.

Returns:

  • (Hash<String, String>)

    the headers of the message.



38
39
40
# File 'lib/kafka/fetched_message.rb', line 38

def headers
  @message.headers
end

#is_control_recordBoolean

Returns whether this record is a control record.

Returns:

  • (Boolean)

    whether this record is a control record



43
44
45
# File 'lib/kafka/fetched_message.rb', line 43

def is_control_record
  @message.is_control_record
end

#keyString

Returns the key of the message.

Returns:

  • (String)

    the key of the message.



23
24
25
# File 'lib/kafka/fetched_message.rb', line 23

def key
  @message.key
end

#offsetInteger

Returns the offset of the message in the partition.

Returns:

  • (Integer)

    the offset of the message in the partition.



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

def offset
  @message.offset
end

#valueString

Returns the value of the message.

Returns:

  • (String)

    the value of the message.



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

def value
  @message.value
end