Package org.apache.pulsar.client.api
Interface MessageRouter
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default int
choosePartition(Message<?> msg)
Deprecated.since 1.22.0.default int
choosePartition(Message<?> msg, TopicMetadata metadata)
Choose a partition based on msg and the topic metadata.
-
-
-
Method Detail
-
choosePartition
@Deprecated default int choosePartition(Message<?> msg)
Deprecated.since 1.22.0. Please usechoosePartition(Message, TopicMetadata)
instead.- Parameters:
msg
- Message object- Returns:
- The index of the partition to use for the message
-
choosePartition
default int choosePartition(Message<?> msg, TopicMetadata metadata)
Choose a partition based on msg and the topic metadata.- Parameters:
msg
- message to routemetadata
- topic metadata- Returns:
- the partition to route the message.
- Since:
- 1.22.0
-
-