Class NonPersistentSubscription

    • Constructor Detail

      • NonPersistentSubscription

        public NonPersistentSubscription​(NonPersistentTopic topic,
                                         java.lang.String subscriptionName,
                                         boolean isDurable,
                                         java.util.Map<java.lang.String,​java.lang.String> properties)
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Subscription
      • addConsumer

        public java.util.concurrent.CompletableFuture<java.lang.Void> addConsumer​(Consumer consumer)
        Specified by:
        addConsumer in interface Subscription
      • acknowledgeMessage

        public void acknowledgeMessage​(java.util.List<org.apache.bookkeeper.mledger.Position> position,
                                       org.apache.pulsar.common.api.proto.CommandAck.AckType ackType,
                                       java.util.Map<java.lang.String,​java.lang.Long> properties)
        Specified by:
        acknowledgeMessage in interface Subscription
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getType

        public org.apache.pulsar.common.api.proto.CommandSubscribe.SubType getType()
        Specified by:
        getType in interface Subscription
      • clearBacklog

        public java.util.concurrent.CompletableFuture<java.lang.Void> clearBacklog()
        Specified by:
        clearBacklog in interface Subscription
      • skipMessages

        public java.util.concurrent.CompletableFuture<java.lang.Void> skipMessages​(int numMessagesToSkip)
        Specified by:
        skipMessages in interface Subscription
      • resetCursor

        public java.util.concurrent.CompletableFuture<java.lang.Void> resetCursor​(long timestamp)
        Specified by:
        resetCursor in interface Subscription
      • peekNthMessage

        public java.util.concurrent.CompletableFuture<org.apache.bookkeeper.mledger.Entry> peekNthMessage​(int messagePosition)
        Specified by:
        peekNthMessage in interface Subscription
      • close

        public java.util.concurrent.CompletableFuture<java.lang.Void> close()
        Specified by:
        close in interface Subscription
      • disconnect

        public java.util.concurrent.CompletableFuture<java.lang.Void> disconnect()
        Disconnect all consumers attached to the dispatcher and close this subscription.
        Specified by:
        disconnect in interface Subscription
        Returns:
        CompletableFuture indicating the completion of disconnect operation
      • delete

        public java.util.concurrent.CompletableFuture<java.lang.Void> delete()
        Delete the subscription by closing and deleting its managed cursor if no consumers are connected to it. Handle unsubscribe call from admin layer.
        Specified by:
        delete in interface Subscription
        Returns:
        CompletableFuture indicating the completion of delete operation
      • deleteForcefully

        public java.util.concurrent.CompletableFuture<java.lang.Void> deleteForcefully()
        Forcefully close all consumers and deletes the subscription.
        Specified by:
        deleteForcefully in interface Subscription
        Returns:
      • doUnsubscribe

        public java.util.concurrent.CompletableFuture<java.lang.Void> doUnsubscribe​(Consumer consumer)
        Handle unsubscribe command from the client API Check with the dispatcher is this consumer can proceed with unsubscribe.
        Specified by:
        doUnsubscribe in interface Subscription
        Parameters:
        consumer - consumer object that is initiating the unsubscribe operation
        Returns:
        CompletableFuture indicating the completion of ubsubscribe operation
      • expireMessages

        public boolean expireMessages​(int messageTTLInSeconds)
        Specified by:
        expireMessages in interface Subscription
      • expireMessages

        public boolean expireMessages​(org.apache.bookkeeper.mledger.Position position)
        Specified by:
        expireMessages in interface Subscription
      • getStats

        public org.apache.pulsar.common.policies.data.stats.NonPersistentSubscriptionStatsImpl getStats()
      • resetCursor

        public java.util.concurrent.CompletableFuture<java.lang.Void> resetCursor​(org.apache.bookkeeper.mledger.Position position)
        Specified by:
        resetCursor in interface Subscription
      • endTxn

        public java.util.concurrent.CompletableFuture<java.lang.Void> endTxn​(long txnidMostBits,
                                                                             long txnidLeastBits,
                                                                             int txnAction,
                                                                             long lowWaterMark)
        Specified by:
        endTxn in interface Subscription
      • getLastActive

        public long getLastActive()
      • updateLastActive

        public void updateLastActive()
      • updateSubscriptionProperties

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateSubscriptionProperties​(java.util.Map<java.lang.String,​java.lang.String> subscriptionProperties)
        Specified by:
        updateSubscriptionProperties in interface Subscription