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: nil, key: nil, topic:, partition:, offset:, create_time: nil) ⇒ FetchedMessage

Returns a new instance of FetchedMessage.



22
23
24
25
26
27
28
29
# File 'lib/kafka/fetched_message.rb', line 22

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

Instance Attribute Details

#create_timeTime (readonly)

Returns the timestamp of the message.

Returns:

  • (Time)

    the timestamp of the message.



20
21
22
# File 'lib/kafka/fetched_message.rb', line 20

def create_time
  @create_time
end

#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