Class: Prosody::Message
- Inherits:
-
Object
- Object
- Prosody::Message
- Defined in:
- lib/prosody/native_stubs.rb
Overview
Represents a Kafka message with its metadata and payload.
Instances of this class are created by the native code and passed to your EventHandler’s #on_message method.
Instance Method Summary collapse
-
#key ⇒ String
Returns the message key used for partitioning.
-
#offset ⇒ Integer
Returns the Kafka offset of this message within its partition.
-
#partition ⇒ Integer
Returns the Kafka partition number for this message.
-
#payload ⇒ Object
Returns the deserialized message payload.
-
#timestamp ⇒ Time
Returns the timestamp when the message was created.
-
#topic ⇒ String
Returns the Kafka topic this message was published to.
Instance Method Details
#key ⇒ String
Returns the message key used for partitioning.
215 216 217 |
# File 'lib/prosody/native_stubs.rb', line 215 def key raise NotImplementedError, "This method is implemented natively in Rust" end |
#offset ⇒ Integer
Returns the Kafka offset of this message within its partition.
208 209 210 |
# File 'lib/prosody/native_stubs.rb', line 208 def offset raise NotImplementedError, "This method is implemented natively in Rust" end |
#partition ⇒ Integer
Returns the Kafka partition number for this message.
201 202 203 |
# File 'lib/prosody/native_stubs.rb', line 201 def partition raise NotImplementedError, "This method is implemented natively in Rust" end |
#payload ⇒ Object
Returns the deserialized message payload.
The payload is automatically deserialized from JSON to Ruby objects.
231 232 233 |
# File 'lib/prosody/native_stubs.rb', line 231 def payload raise NotImplementedError, "This method is implemented natively in Rust" end |
#timestamp ⇒ Time
Returns the timestamp when the message was created.
222 223 224 |
# File 'lib/prosody/native_stubs.rb', line 222 def raise NotImplementedError, "This method is implemented natively in Rust" end |
#topic ⇒ String
Returns the Kafka topic this message was published to.
194 195 196 |
# File 'lib/prosody/native_stubs.rb', line 194 def topic raise NotImplementedError, "This method is implemented natively in Rust" end |