Class PartialRoundRobinMessageRouterImpl

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.pulsar.client.api.MessageRouter

    public class PartialRoundRobinMessageRouterImpl
    extends java.lang.Object
    implements org.apache.pulsar.client.api.MessageRouter
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int choosePartition​(org.apache.pulsar.client.api.Message<?> msg, org.apache.pulsar.client.api.TopicMetadata metadata)
      Choose a partition based on the topic metadata.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.pulsar.client.api.MessageRouter

        choosePartition
    • Constructor Detail

      • PartialRoundRobinMessageRouterImpl

        public PartialRoundRobinMessageRouterImpl​(int numPartitionsLimit)
    • Method Detail

      • choosePartition

        public int choosePartition​(org.apache.pulsar.client.api.Message<?> msg,
                                   org.apache.pulsar.client.api.TopicMetadata metadata)
        Choose a partition based on the topic metadata. Key hash routing isn't supported.
        Specified by:
        choosePartition in interface org.apache.pulsar.client.api.MessageRouter
        Parameters:
        msg - message
        metadata - topic metadata
        Returns:
        the partition to route the message.