Interface TopicMessageId
- All Superinterfaces:
Comparable<MessageId>, MessageId, Serializable
It's guaranteed that Message.getMessageId() must return a TopicMessageId instance if the Message is received
from a consumer that subscribes multiple topics or partitioned topics.
The topic name used in APIs related to this class like `getOwnerTopic` and `create` must be the full topic name. For
example, "my-topic" is invalid while "persistent://public/default/my-topic" is valid.
If the topic is a partitioned topic, the topic name should be the name of the specific partition, e.g.
"persistent://public/default/my-topic-partition-0".
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TopicMessageIdReturn the owner topic name of a message.booleanhasSameBasePartitionedTopic(String topicName) Checks if this message's owner topic and the given topic refer to the same base partitioned topic by comparing their base partitioned topic names.Methods inherited from interface Comparable
compareToMethods inherited from interface MessageId
toByteArray
-
Method Details
-
getOwnerTopic
-
hasSameBasePartitionedTopic
Checks if this message's owner topic and the given topic refer to the same base partitioned topic by comparing their base partitioned topic names.For example,
persistent://public/default/my-topic-partition-0matchespersistent://public/default/my-topicor any other partition of that topic. Topics sharing only a name prefix (e.g.,my-topicvsmy-topic-v2) do not match.- Parameters:
topicName- a full topic name (non-partitioned, partitioned, or specific partition)- Returns:
trueif both topics resolve to the same base partitioned topic name
-
create
-