Package org.apache.pulsar.client.api
Interface MessagePayload
-
public interface MessagePayload
The abstraction of a message's payload.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description byte[]
copiedBuffer()
Copy the bytes of the payload into the byte array.default void
release()
Release the resources if necessary.
-
-
-
Method Detail
-
copiedBuffer
byte[] copiedBuffer()
Copy the bytes of the payload into the byte array.- Returns:
- the byte array that is filled with the readable bytes of the payload, it should not be null
-
release
default void release()
Release the resources if necessary. NOTE: For a MessagePayload object that is created fromMessagePayloadFactory.DEFAULT
, this method must be called to avoid memory leak.
-
-