Class: Kafka::FetchedMessage
- Inherits:
-
Object
- Object
- Kafka::FetchedMessage
- Defined in:
- lib/kafka/fetched_message.rb
Instance Attribute Summary collapse
-
#create_time ⇒ Time
readonly
The timestamp of the message.
-
#key ⇒ String
readonly
The key of the message.
-
#offset ⇒ Integer
readonly
The offset of the message in the partition.
-
#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.
-
#value ⇒ String
readonly
The value of the message.
Instance Method Summary collapse
-
#initialize(value: nil, key: nil, topic:, partition:, offset:, create_time: nil) ⇒ FetchedMessage
constructor
A new instance of FetchedMessage.
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_time ⇒ Time (readonly)
Returns the timestamp of the message.
20 21 22 |
# File 'lib/kafka/fetched_message.rb', line 20 def create_time @create_time end |
#key ⇒ String (readonly)
Returns the key of the message.
8 9 10 |
# File 'lib/kafka/fetched_message.rb', line 8 def key @key end |
#offset ⇒ Integer (readonly)
Returns the offset of the message in the partition.
17 18 19 |
# File 'lib/kafka/fetched_message.rb', line 17 def offset @offset end |
#partition ⇒ Integer (readonly)
Returns the partition number that the message was written to.
14 15 16 |
# File 'lib/kafka/fetched_message.rb', line 14 def partition @partition end |
#topic ⇒ String (readonly)
Returns 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 |
#value ⇒ String (readonly)
Returns the value of the message.
5 6 7 |
# File 'lib/kafka/fetched_message.rb', line 5 def value @value end |