Package org.apache.pulsar.broker.service
Class AbstractSubscription
java.lang.Object
org.apache.pulsar.broker.service.AbstractSubscription
- All Implemented Interfaces:
MessageExpirer,Subscription
- Direct Known Subclasses:
NonPersistentSubscription,PersistentSubscription
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<CompletableFuture<Void>>checkForConsumerCompatibilityErrorWithDispatcher(Dispatcher dispatcher, Consumer consumer) Checks if the given consumer is compatible with the given dispatcher.longlongMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.broker.service.MessageExpirer
expireMessages, expireMessagesMethods inherited from interface org.apache.pulsar.broker.service.Subscription
acknowledgeMessage, addConsumer, addUnAckedMessages, analyzeBacklog, clearBacklog, close, consumerFlow, delete, deleteForcefully, disconnect, doUnsubscribe, doUnsubscribe, endTxn, getConsumers, getDispatcher, getExpiredMessageRate, getName, getNumberOfEntriesDelayed, getNumberOfEntriesInBacklog, getNumberOfSameAddressConsumers, getSubscriptionProperties, getTopic, getTopicName, getType, getTypeString, interceptor, isReplicated, isSubscriptionMigrated, markTopicWithBatchMessagePublished, peekNthMessage, processReplicatedSubscriptionSnapshot, redeliverUnacknowledgedMessages, redeliverUnacknowledgedMessages, removeConsumer, removeConsumer, resetCursor, resetCursor, skipMessages, updateSubscriptionProperties
-
Field Details
-
bytesOutFromRemovedConsumers
-
msgOutFromRemovedConsumer
-
-
Constructor Details
-
AbstractSubscription
public AbstractSubscription()
-
-
Method Details
-
getMsgOutCounter
public long getMsgOutCounter() -
getBytesOutCounter
public long getBytesOutCounter() -
checkForConsumerCompatibilityErrorWithDispatcher
protected Optional<CompletableFuture<Void>> checkForConsumerCompatibilityErrorWithDispatcher(Dispatcher dispatcher, Consumer consumer) Checks if the given consumer is compatible with the given dispatcher. They are incompatible if- the subscription type of the consumer differs from the subscription type of the dispatcher or
- if both the consumer and dispatcher are of
CommandSubscribe.SubType.Key_Sharedtype but their policies differ (KeySharedMode.AUTO_SPLIT/KeySharedMode.STICKYor allowOutOfOrderDelivery true/false).
- Parameters:
dispatcher- The dispatcher of the subscriptionconsumer- New consumer to be added to the subscription- Returns:
- Optional containing failed future with
BrokerServiceException.SubscriptionBusyExceptionif consumer and dispatcher are incompatible or empty optional otherwise.
-