Package org.apache.pulsar.client.api
Class KeySharedPolicy
java.lang.Object
org.apache.pulsar.client.api.KeySharedPolicy
- Direct Known Subclasses:
KeySharedPolicy.KeySharedPolicyAutoSplit
,KeySharedPolicy.KeySharedPolicySticky
KeyShared policy for KeyShared subscription.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Auto split hash range key shared policy.static class
Sticky attach topic with fixed hash range. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
setAllowOutOfOrderDelivery
(boolean allowOutOfOrderDelivery) If enabled, it will relax the ordering requirement, allowing the broker to send out-of-order messages in case of failures.abstract void
validate()
-
Field Details
-
allowOutOfOrderDelivery
protected boolean allowOutOfOrderDelivery -
DEFAULT_HASH_RANGE_SIZE
public static final int DEFAULT_HASH_RANGE_SIZE- See Also:
-
Constructor Details
-
KeySharedPolicy
public KeySharedPolicy()
-
-
Method Details
-
autoSplitHashRange
-
stickyHashRange
-
validate
public abstract void validate() -
setAllowOutOfOrderDelivery
If enabled, it will relax the ordering requirement, allowing the broker to send out-of-order messages in case of failures. This will make it faster for new consumers to join without being stalled by an existing slow consumer.In this case, a single consumer will still receive all the keys, but they may be coming in different orders.
- Parameters:
allowOutOfOrderDelivery
- whether to allow for out of order delivery- Returns:
- KeySharedPolicy instance
-
isAllowOutOfOrderDelivery
public boolean isAllowOutOfOrderDelivery() -
getHashRangeTotal
public int getHashRangeTotal()
-