接口 MessageId
- 所有超级接口:
Comparable<MessageId>
,Serializable
Opaque unique identifier of a single message
The MessageId can be used to reference a specific message, for example when acknowledging, without having to retain the message content in memory for an extended period of time.
Message ids are Comparable
and a bigger message id will imply that a message was published "after"
the other one.
-
字段概要
字段 -
方法概要
修饰符和类型方法说明static MessageId
fromByteArray
(byte[] data) De-serialize a message id from a byte array.static MessageId
fromByteArrayWithTopic
(byte[] data, String topicName) De-serialize a message id from a byte array with its topic information attached.byte[]
Serialize the message ID into a byte array.从接口继承的方法 java.lang.Comparable
compareTo
-
字段详细资料
-
earliest
MessageId that represents the oldest message available in the topic. -
latest
MessageId that represents the next message published in the topic.
-
-
方法详细资料
-
toByteArray
byte[] toByteArray()Serialize the message ID into a byte array.The serialized message id can be stored away and later get deserialized by using
fromByteArray(byte[])
. -
fromByteArray
De-serialize a message id from a byte array.- 参数:
data
- byte array containing the serialized message id- 返回:
- the de-serialized messageId object
- 抛出:
IOException
- if the de-serialization fails
-
fromByteArrayWithTopic
De-serialize a message id from a byte array with its topic information attached.The topic information is needed when acknowledging a
MessageId
on a consumer that is consuming from multiple topics.- 参数:
data
- the byte array with the serialized message idtopicName
- the topic name- 返回:
- a
instance
- 抛出:
IOException
- if the de-serialization fails
-