Class: Prosody::Message

Inherits:
Object
  • Object
show all
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.

See Also:

  • for implementation

Instance Method Summary collapse

Instance Method Details

#keyString

Returns the message key used for partitioning.

Returns:

  • (String)

    The message key

Raises:

  • (NotImplementedError)


215
216
217
# File 'lib/prosody/native_stubs.rb', line 215

def key
  raise NotImplementedError, "This method is implemented natively in Rust"
end

#offsetInteger

Returns the Kafka offset of this message within its partition.

Returns:

  • (Integer)

    The message offset

Raises:

  • (NotImplementedError)


208
209
210
# File 'lib/prosody/native_stubs.rb', line 208

def offset
  raise NotImplementedError, "This method is implemented natively in Rust"
end

#partitionInteger

Returns the Kafka partition number for this message.

Returns:

  • (Integer)

    The partition number

Raises:

  • (NotImplementedError)


201
202
203
# File 'lib/prosody/native_stubs.rb', line 201

def partition
  raise NotImplementedError, "This method is implemented natively in Rust"
end

#payloadObject

Returns the deserialized message payload.

The payload is automatically deserialized from JSON to Ruby objects.

Returns:

  • (Object)

    The message content

Raises:

  • (NotImplementedError)


231
232
233
# File 'lib/prosody/native_stubs.rb', line 231

def payload
  raise NotImplementedError, "This method is implemented natively in Rust"
end

#timestampTime

Returns the timestamp when the message was created.

Returns:

  • (Time)

    The message timestamp

Raises:

  • (NotImplementedError)


222
223
224
# File 'lib/prosody/native_stubs.rb', line 222

def timestamp
  raise NotImplementedError, "This method is implemented natively in Rust"
end

#topicString

Returns the Kafka topic this message was published to.

Returns:

  • (String)

    The topic name

Raises:

  • (NotImplementedError)


194
195
196
# File 'lib/prosody/native_stubs.rb', line 194

def topic
  raise NotImplementedError, "This method is implemented natively in Rust"
end