Interface TopicMessageId

All Superinterfaces:
Comparable<MessageId>, MessageId, Serializable

public interface TopicMessageId extends MessageId
The MessageId used for a consumer that subscribes multiple topics or partitioned topics.

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".

  • Method Details

    • getOwnerTopic

      String getOwnerTopic()
      Return the owner topic name of a message.
      Returns:
      the owner topic
    • create

      static TopicMessageId create(String topic, MessageId messageId)