Class: Kafka::FetchedMessage
- Inherits:
-
Object
- Object
- Kafka::FetchedMessage
- Defined in:
- lib/kafka/fetched_message.rb
Instance Attribute Summary collapse
-
#partition ⇒ Integer
readonly
The partition number that the message was written to.
-
#topic ⇒ String
readonly
The name of the topic that the message was written to.
Instance Method Summary collapse
-
#create_time ⇒ Time
The timestamp of the message.
-
#initialize(message:, topic:, partition:) ⇒ FetchedMessage
constructor
A new instance of FetchedMessage.
-
#key ⇒ String
The key of the message.
-
#offset ⇒ Integer
The offset of the message in the partition.
-
#value ⇒ String
The value of the message.
Constructor Details
#initialize(message:, topic:, partition:) ⇒ FetchedMessage
Returns a new instance of FetchedMessage.
9 10 11 12 13 |
# File 'lib/kafka/fetched_message.rb', line 9 def initialize(message:, topic:, partition:) @message = @topic = topic @partition = partition end |
Instance Attribute Details
#partition ⇒ Integer (readonly)
Returns the partition number that the message was written to.
7 8 9 |
# File 'lib/kafka/fetched_message.rb', line 7 def partition @partition end |
#topic ⇒ String (readonly)
Returns the name of the topic that the message was written to.
4 5 6 |
# File 'lib/kafka/fetched_message.rb', line 4 def topic @topic end |
Instance Method Details
#create_time ⇒ Time
Returns the timestamp of the message.
31 32 33 |
# File 'lib/kafka/fetched_message.rb', line 31 def create_time @message.create_time end |
#key ⇒ String
Returns the key of the message.
21 22 23 |
# File 'lib/kafka/fetched_message.rb', line 21 def key @message.key end |
#offset ⇒ Integer
Returns the offset of the message in the partition.
26 27 28 |
# File 'lib/kafka/fetched_message.rb', line 26 def offset @message.offset end |
#value ⇒ String
Returns the value of the message.
16 17 18 |
# File 'lib/kafka/fetched_message.rb', line 16 def value @message.value end |