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.
-
#headers ⇒ Hash<String, String>
The headers of the message.
-
#initialize(message:, topic:, partition:) ⇒ FetchedMessage
constructor
A new instance of FetchedMessage.
-
#is_control_record ⇒ Boolean
Whether this record is a control record.
-
#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.
11 12 13 14 15 |
# File 'lib/kafka/fetched_message.rb', line 11 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.
9 10 11 |
# File 'lib/kafka/fetched_message.rb', line 9 def partition @partition end |
#topic ⇒ String (readonly)
Returns 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_time ⇒ Time
Returns the timestamp of the message.
33 34 35 |
# File 'lib/kafka/fetched_message.rb', line 33 def create_time @message.create_time end |
#headers ⇒ Hash<String, String>
Returns the headers of the message.
38 39 40 |
# File 'lib/kafka/fetched_message.rb', line 38 def headers @message.headers end |
#is_control_record ⇒ Boolean
Returns 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 |
#key ⇒ String
Returns the key of the message.
23 24 25 |
# File 'lib/kafka/fetched_message.rb', line 23 def key @message.key end |
#offset ⇒ Integer
Returns the offset of the message in the partition.
28 29 30 |
# File 'lib/kafka/fetched_message.rb', line 28 def offset @message.offset end |
#value ⇒ String
Returns the value of the message.
18 19 20 |
# File 'lib/kafka/fetched_message.rb', line 18 def value @message.value end |