Package org.apache.pulsar.client.admin
Interface Topics
public interface Topics
Admin interface for Topics management.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionanalyzeSubscriptionBacklog
(String topic, String subscriptionName, Optional<org.apache.pulsar.client.api.MessageId> startPosition) Analyze subscription backlog.analyzeSubscriptionBacklogAsync
(String topic, String subscriptionName, Optional<org.apache.pulsar.client.api.MessageId> startPosition) Analyze subscription backlog.compactionStatus
(String topic) Check the status of an ongoing compaction for a topic.compactionStatusAsync
(String topic) Check the status of an ongoing compaction for a topic asynchronously.void
createMissedPartitions
(String topic) Create missed partitions for partitioned topic.Create missed partitions for partitioned topic asynchronously.default void
createNonPartitionedTopic
(String topic) Create a non-partitioned topic.void
createNonPartitionedTopic
(String topic, Map<String, String> properties) Create a non-partitioned topic.default CompletableFuture<Void>
Create a non-partitioned topic asynchronously.createNonPartitionedTopicAsync
(String topic, Map<String, String> properties) Create a non-partitioned topic asynchronously.default void
createPartitionedTopic
(String topic, int numPartitions) Create a partitioned topic.void
createPartitionedTopic
(String topic, int numPartitions, Map<String, String> properties) Create a partitioned topic.default CompletableFuture<Void>
createPartitionedTopicAsync
(String topic, int numPartitions) Create a partitioned topic asynchronously.createPartitionedTopicAsync
(String topic, int numPartitions, Map<String, String> properties) Create a partitioned topic asynchronously.default void
createSubscription
(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId) Create a new subscription on a topic.default void
createSubscription
(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean replicated) Create a new subscription on a topic.void
createSubscription
(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean replicated, Map<String, String> properties) Create a new subscription on a topic.default CompletableFuture<Void>
createSubscriptionAsync
(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId) Create a new subscription on a topic.default CompletableFuture<Void>
createSubscriptionAsync
(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean replicated) Create a new subscription on a topic.createSubscriptionAsync
(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean replicated, Map<String, String> properties) Create a new subscription on a topic.void
Delete a topic.default void
void
Deprecated.deleteAsync
(String topic) Delete a topic asynchronously.default CompletableFuture<Void>
deleteAsync
(String topic, boolean force) deleteAsync
(String topic, boolean force, boolean deleteSchema) Deprecated.UsedeleteAsync(String, boolean)
instead because parameter `deleteSchema` is always truevoid
deletePartitionedTopic
(String topic) Delete a partitioned topic.default void
deletePartitionedTopic
(String topic, boolean force) void
deletePartitionedTopic
(String topic, boolean force, boolean deleteSchema) Deprecated.UsedeletePartitionedTopic(String, boolean)
instead because parameter `deleteSchema` is always trueDelete a partitioned topic asynchronously.default CompletableFuture<Void>
deletePartitionedTopicAsync
(String topic, boolean force) deletePartitionedTopicAsync
(String topic, boolean force, boolean deleteSchema) Deprecated.UsedeletePartitionedTopicAsync(String, boolean)
instead because parameter `deleteSchema` is always truevoid
deleteSubscription
(String topic, String subName) Delete a subscription.void
deleteSubscription
(String topic, String subName, boolean force) Delete a subscription.deleteSubscriptionAsync
(String topic, String subName) Delete a subscription asynchronously.deleteSubscriptionAsync
(String topic, String subName, boolean force) Delete a subscription asynchronously.void
disableDeduplication
(String topic) Deprecated.UseTopicPolicies.removeDeduplicationStatus(String)
instead.disableDeduplicationAsync
(String topic) Deprecated.UseTopicPolicies.removeDeduplicationStatusAsync(String)
instead.void
enableDeduplication
(String topic, boolean enabled) Deprecated.enableDeduplicationAsync
(String topic, boolean enabled) Deprecated.org.apache.pulsar.client.api.Message<byte[]>
examineMessage
(String topic, String initialPosition, long messagePosition) Examine a specific message on a topic by position relative to the earliest or the latest message.CompletableFuture<org.apache.pulsar.client.api.Message<byte[]>>
examineMessageAsync
(String topic, String initialPosition, long messagePosition) Examine a specific message on a topic by position relative to the earliest or the latest message.void
expireMessages
(String topic, String subscriptionName, long expireTimeInSeconds) Expire all messages older than given N (expireTimeInSeconds) seconds for a given subscription.void
expireMessages
(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean isExcluded) Expire all messages older than given N (expireTimeInSeconds) seconds for a given subscription.expireMessagesAsync
(String topic, String subscriptionName, long expireTimeInSeconds) Expire all messages older than given N (expireTimeInSeconds) seconds for a given subscription asynchronously.expireMessagesAsync
(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean isExcluded) Expire all messages older than given N (expireTimeInSeconds) seconds for a given subscription asynchronously.void
expireMessagesForAllSubscriptions
(String topic, long expireTimeInSeconds) Expire all messages older than given N seconds for all subscriptions of the persistent-topic.expireMessagesForAllSubscriptionsAsync
(String topic, long expireTimeInSeconds) Expire all messages older than given N seconds for all subscriptions of the persistent-topic asynchronously.getBacklogQuotaMap
(String topic) Deprecated.UseTopicPolicies.getBacklogQuotaMap(String)
instead.getBacklogQuotaMap
(String topic, boolean applied) Deprecated.UseTopicPolicies.getBacklogQuotaMap(String, boolean)
instead.getBacklogSizeByMessageId
(String topic, org.apache.pulsar.client.api.MessageId messageId) Get backlog size by a message ID.getBacklogSizeByMessageIdAsync
(String topic, org.apache.pulsar.client.api.MessageId messageId) Get backlog size by a message ID asynchronously.getCompactionThreshold
(String topic) Deprecated.UseTopicPolicies.getCompactionThreshold(String)
instead.getCompactionThreshold
(String topic, boolean applied) Deprecated.Deprecated.UseTopicPolicies.getCompactionThresholdAsync(String)
instead.getCompactionThresholdAsync
(String topic, boolean applied) Deprecated.getDeduplicationEnabled
(String topic) Deprecated.UseTopicPolicies.getDeduplicationStatus(String)
instead.Deprecated.UseTopicPolicies.getDeduplicationStatusAsync(String)
instead.Deprecated.Deprecated.getDeduplicationStatus
(String topic) Deprecated.UseTopicPolicies.getDeduplicationStatus(String)
instead.getDeduplicationStatus
(String topic, boolean applied) Deprecated.Deprecated.UseTopicPolicies.getDeduplicationStatusAsync(String)
instead.getDeduplicationStatusAsync
(String topic, boolean applied) Deprecated.getDelayedDeliveryPolicy
(String topic) Deprecated.UseTopicPolicies.getDelayedDeliveryPolicy(String)
instead.getDelayedDeliveryPolicy
(String topic, boolean applied) Deprecated.Deprecated.UseTopicPolicies.getDelayedDeliveryPolicyAsync(String)
instead.getDelayedDeliveryPolicyAsync
(String topic, boolean applied) Deprecated.getDispatchRate
(String topic) Deprecated.UseTopicPolicies.getDispatchRate(String)
instead.getDispatchRate
(String topic, boolean applied) Deprecated.UseTopicPolicies.getDispatchRate(String, boolean)
instead.getDispatchRateAsync
(String topic) Deprecated.UseTopicPolicies.getDispatchRateAsync(String)
instead.getDispatchRateAsync
(String topic, boolean applied) Deprecated.UseTopicPolicies.getDispatchRateAsync(String, boolean)
instead.getInactiveTopicPolicies
(String topic) Deprecated.UseTopicPolicies.getInactiveTopicPolicies(String)
instead.getInactiveTopicPolicies
(String topic, boolean applied) Deprecated.Deprecated.UseTopicPolicies.getInactiveTopicPoliciesAsync(String)
instead.getInactiveTopicPoliciesAsync
(String topic, boolean applied) Deprecated.getInternalInfo
(String topic) Get a JSON representation of the topic metadata stored in ZooKeeper.getInternalInfoAsync
(String topic) Get a JSON representation of the topic metadata stored in ZooKeeper.getInternalStats
(String topic) Get the internal stats for the topic.getInternalStats
(String topic, boolean metadata) Get the internal stats for the topic.getInternalStatsAsync
(String topic) Get the internal stats for the topic asynchronously.getInternalStatsAsync
(String topic, boolean metadata) Get the internal stats for the topic asynchronously.org.apache.pulsar.client.api.MessageId
getLastMessageId
(String topic) Get the last commit message Id of a topic.CompletableFuture<org.apache.pulsar.client.api.MessageId>
getLastMessageIdAsync
(String topic) Get the last commit message Id of a topic asynchronously.Get the both persistent and non-persistent topics under a namespace.getList
(String namespace, TopicDomain topicDomain) Get the list of topics under a namespace.getList
(String namespace, TopicDomain topicDomain, Map<Topics.QueryParam, Object> params) Deprecated.usegetList(String, TopicDomain, ListTopicsOptions)
instead.getList
(String namespace, TopicDomain topicDomain, ListTopicsOptions options) Get the list of topics under a namespace.getListAsync
(String namespace) Get both persistent and non-persistent topics under a namespace asynchronously.getListAsync
(String namespace, TopicDomain topicDomain) Get the list of topics under a namespace asynchronously.getListAsync
(String namespace, TopicDomain topicDomain, Map<Topics.QueryParam, Object> params) Deprecated.usegetListAsync(String, TopicDomain, ListTopicsOptions)
instead.getListAsync
(String namespace, TopicDomain topicDomain, ListTopicsOptions options) Get the list of topics under a namespace asynchronously.getListInBundle
(String namespace, String bundleRange) Get list of topics exist into given bundle.getListInBundleAsync
(String namespace, String bundleRange) Get list of topics exist into given bundle asynchronously.getMaxConsumers
(String topic) Deprecated.UseTopicPolicies.getMaxConsumers(String)
instead.getMaxConsumers
(String topic, boolean applied) Deprecated.UseTopicPolicies.getMaxConsumers(String, boolean)
instead.getMaxConsumersAsync
(String topic) Deprecated.UseTopicPolicies.getMaxConsumersAsync(String)
instead.getMaxConsumersAsync
(String topic, boolean applied) Deprecated.UseTopicPolicies.getMaxConsumersAsync(String, boolean)
instead.Deprecated.UseTopicPolicies.getMaxConsumersPerSubscription(String)
instead.Deprecated.getMaxMessageSize
(String topic) Deprecated.UseTopicPolicies.getMaxMessageSize(String)
instead.getMaxMessageSizeAsync
(String topic) Deprecated.UseTopicPolicies.getMaxMessageSizeAsync(String)
instead.getMaxProducers
(String topic) Deprecated.UseTopicPolicies.getMaxProducers(String)
instead.getMaxProducers
(String topic, boolean applied) Deprecated.UseTopicPolicies.getMaxProducers(String, boolean)
instead.getMaxProducersAsync
(String topic) Deprecated.UseTopicPolicies.getMaxProducersAsync(String)
instead.getMaxProducersAsync
(String topic, boolean applied) Deprecated.UseTopicPolicies.getMaxProducersAsync(String, boolean)
instead.Deprecated.UseTopicPolicies.getMaxSubscriptionsPerTopic(String)
instead.Deprecated.Deprecated.getMaxUnackedMessagesOnConsumer
(String topic, boolean applied) Deprecated.Deprecated.getMaxUnackedMessagesOnConsumerAsync
(String topic, boolean applied) Deprecated.Deprecated.getMaxUnackedMessagesOnSubscription
(String topic, boolean applied) Deprecated.Deprecated.getMaxUnackedMessagesOnSubscriptionAsync
(String topic, boolean applied) Deprecated.org.apache.pulsar.client.api.Message<byte[]>
getMessageById
(String topic, long ledgerId, long entryId) Get a message by its messageId via a topic subscription.CompletableFuture<org.apache.pulsar.client.api.Message<byte[]>>
getMessageByIdAsync
(String topic, long ledgerId, long entryId) Get a message by its messageId via a topic subscription asynchronously.org.apache.pulsar.client.api.MessageId
getMessageIdByTimestamp
(String topic, long timestamp) Get message ID published at or just after this absolute timestamp (in ms).CompletableFuture<org.apache.pulsar.client.api.MessageId>
getMessageIdByTimestampAsync
(String topic, long timestamp) Get message ID published at or just after this absolute timestamp (in ms) asynchronously.getMessageTTL
(String topic) Deprecated.UseTopicPolicies.getMessageTTL(String)
instead.getMessageTTL
(String topic, boolean applied) Deprecated.UseTopicPolicies.getMessageTTL(String, boolean)
instead.getOffloadPolicies
(String topic) Deprecated.UseTopicPolicies.getOffloadPolicies(String)
instead.getOffloadPolicies
(String topic, boolean applied) Deprecated.UseTopicPolicies.getOffloadPolicies(String, boolean)
instead.getOffloadPoliciesAsync
(String topic) Deprecated.UseTopicPolicies.getOffloadPoliciesAsync(String)
instead.getOffloadPoliciesAsync
(String topic, boolean applied) Deprecated.Get the stats for the partitioned topic.Get the stats-internal for the partitioned topic asynchronously.default PartitionedTopicStats
getPartitionedStats
(String topic, boolean perPartition) getPartitionedStats
(String topic, boolean perPartition, boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) Get the stats for the partitioned topicdefault CompletableFuture<PartitionedTopicStats>
getPartitionedStatsAsync
(String topic, boolean perPartition) getPartitionedStatsAsync
(String topic, boolean perPartition, boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) Get the stats for the partitioned topic asynchronously.getPartitionedTopicList
(String namespace) Get the list of partitioned topics under a namespace.getPartitionedTopicList
(String namespace, ListTopicsOptions options) Get the list of partitioned topics under a namespace.getPartitionedTopicListAsync
(String namespace) Get the list of partitioned topics under a namespace asynchronously.getPartitionedTopicListAsync
(String namespace, ListTopicsOptions options) Get the list of partitioned topics under a namespace asynchronously.Get metadata of a partitioned topic.Get metadata of a partitioned topic asynchronously.getPermissions
(String topic) Get permissions on a topic.getPermissionsAsync
(String topic) Get permissions on a topic asynchronously.getPersistence
(String topic) Deprecated.UseTopicPolicies.getPersistence(String)
instead.getPersistence
(String topic, boolean applied) Deprecated.UseTopicPolicies.getPersistence(String, boolean)
instead.getPersistenceAsync
(String topic) Deprecated.UseTopicPolicies.getPersistenceAsync(String)
instead.getPersistenceAsync
(String topic, boolean applied) Deprecated.UseTopicPolicies.getPersistenceAsync(String, boolean)
instead.getProperties
(String topic) Get properties of a topic.getPropertiesAsync
(String topic) Get properties of a topic asynchronously.getPublishRate
(String topic) Deprecated.UseTopicPolicies.getPublishRate(String)
instead.getPublishRateAsync
(String topic) Deprecated.UseTopicPolicies.getPublishRateAsync(String)
instead.getReplicatedSubscriptionStatus
(String topic, String subName) Get replicated subscription status on a topic.getReplicatedSubscriptionStatusAsync
(String topic, String subName) Get replicated subscription status on a topic asynchronously.getReplicationClusters
(String topic, boolean applied) Get the replication clusters for a topic.getReplicationClustersAsync
(String topic, boolean applied) Get the replication clusters for a topic asynchronously.getReplicatorDispatchRate
(String topic) Deprecated.UseTopicPolicies.getReplicatorDispatchRate(String)
instead.getReplicatorDispatchRate
(String topic, boolean applied) Deprecated.Deprecated.UseTopicPolicies.getReplicatorDispatchRateAsync(String)
instead.getReplicatorDispatchRateAsync
(String topic, boolean applied) Deprecated.getRetention
(String topic) Deprecated.UseTopicPolicies.getRetention(String)
instead.getRetention
(String topic, boolean applied) Deprecated.UseTopicPolicies.getRetention(String, boolean)
instead.getRetentionAsync
(String topic) Deprecated.UseTopicPolicies.getRetentionAsync(String)
instead.getRetentionAsync
(String topic, boolean applied) Deprecated.UseTopicPolicies.getRetentionAsync(String, boolean)
instead.boolean
getSchemaValidationEnforced
(String topic, boolean applied) Get schema validation enforced for a topic.getSchemaValidationEnforcedAsync
(String topic, boolean applied) Get schema validation enforced for a topic asynchronously.default TopicStats
default TopicStats
default TopicStats
default TopicStats
getStats
(String topic, boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) getStats
(String topic, GetStatsOptions getStatsOptions) Get the stats for the topic.default CompletableFuture<TopicStats>
getStatsAsync
(String topic) getStatsAsync
(String topic, boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) Get the stats for the topic asynchronously.getSubscribeRate
(String topic) Deprecated.UseTopicPolicies.getSubscribeRate(String)
instead.getSubscribeRate
(String topic, boolean applied) Deprecated.UseTopicPolicies.getSubscribeRate(String, boolean)
instead.getSubscribeRateAsync
(String topic) Deprecated.UseTopicPolicies.getSubscribeRateAsync(String)
instead.getSubscribeRateAsync
(String topic, boolean applied) Deprecated.UseTopicPolicies.getSubscribeRateAsync(String, boolean)
instead.Deprecated.UseTopicPolicies.getSubscriptionDispatchRate(String)
instead.getSubscriptionDispatchRate
(String namespace, boolean applied) Deprecated.Deprecated.getSubscriptionDispatchRateAsync
(String namespace, boolean applied) Deprecated.getSubscriptionProperties
(String topic, String subName) Get Subscription Properties on a topic subscription.getSubscriptionPropertiesAsync
(String topic, String subName) Get Subscription Properties on a topic subscription.getSubscriptions
(String topic) Get the list of subscriptions.getSubscriptionsAsync
(String topic) Get the list of subscriptions asynchronously.Set<org.apache.pulsar.client.api.SubscriptionType>
Deprecated.UseTopicPolicies.getSubscriptionTypesEnabled(String)
instead.CompletableFuture<Set<org.apache.pulsar.client.api.SubscriptionType>>
Deprecated.void
grantPermission
(String topic, String role, Set<AuthAction> actions) Grant permission on a topic.grantPermissionAsync
(String topic, String role, Set<AuthAction> actions) Grant permission on a topic asynchronously.offloadStatus
(String topic) Check the status of an ongoing offloading operation for a topic.offloadStatusAsync
(String topic) Check the status of an ongoing offloading operation for a topic asynchronously.List<org.apache.pulsar.client.api.Message<byte[]>>
peekMessages
(String topic, String subName, int numMessages) Peek messages from a topic subscription.CompletableFuture<List<org.apache.pulsar.client.api.Message<byte[]>>>
peekMessagesAsync
(String topic, String subName, int numMessages) Peek messages from a topic subscription asynchronously.default void
removeBacklogQuota
(String topic) Deprecated.UseTopicPolicies.removeBacklogQuota(String)
instead.void
removeBacklogQuota
(String topic, BacklogQuota.BacklogQuotaType backlogQuotaType) Deprecated.void
removeCompactionThreshold
(String topic) Deprecated.UseTopicPolicies.removeCompactionThreshold(String)
instead.Deprecated.UseTopicPolicies.removeCompactionThresholdAsync(String)
instead.void
Deprecated.Deprecated.void
removeDeduplicationStatus
(String topic) Deprecated.UseTopicPolicies.removeDeduplicationStatus(String)
instead.Deprecated.UseTopicPolicies.removeDeduplicationStatusAsync(String)
instead.void
Deprecated.UseTopicPolicies.removeDelayedDeliveryPolicy(String)
instead.Deprecated.void
removeDispatchRate
(String topic) Deprecated.UseTopicPolicies.removeDispatchRate(String)
instead.removeDispatchRateAsync
(String topic) Deprecated.UseTopicPolicies.removeDispatchRateAsync(String)
instead.void
Deprecated.UseTopicPolicies.removeInactiveTopicPolicies(String)
instead.Deprecated.void
removeMaxConsumers
(String topic) Deprecated.UseTopicPolicies.removeMaxConsumers(String)
instead.removeMaxConsumersAsync
(String topic) Deprecated.UseTopicPolicies.removeMaxConsumersAsync(String)
instead.void
Deprecated.Deprecated.void
removeMaxMessageSize
(String topic) Deprecated.UseTopicPolicies.removeMaxMessageSize(String)
instead.removeMaxMessageSizeAsync
(String topic) Deprecated.UseTopicPolicies.removeMaxMessageSizeAsync(String)
instead.void
removeMaxProducers
(String topic) Deprecated.UseTopicPolicies.removeMaxProducers(String)
instead.removeMaxProducersAsync
(String topic) Deprecated.UseTopicPolicies.removeMaxProducersAsync(String)
instead.void
Deprecated.UseTopicPolicies.removeMaxSubscriptionsPerTopic(String)
instead.Deprecated.void
Deprecated.Deprecated.void
Deprecated.Deprecated.void
removeMessageTTL
(String topic) Deprecated.UseTopicPolicies.removeMessageTTL(String)
instead.void
removeOffloadPolicies
(String topic) Deprecated.UseTopicPolicies.removeOffloadPolicies(String)
instead.removeOffloadPoliciesAsync
(String topic) Deprecated.UseTopicPolicies.removeOffloadPoliciesAsync(String)
instead.void
removePersistence
(String topic) Deprecated.UseTopicPolicies.removePersistence(String)
instead.removePersistenceAsync
(String topic) Deprecated.UseTopicPolicies.removePersistenceAsync(String)
instead.void
removePublishRate
(String topic) Deprecated.UseTopicPolicies.removePublishRate(String)
instead.removePublishRateAsync
(String topic) Deprecated.UseTopicPolicies.removePublishRateAsync(String)
instead.void
removeReplicationClusters
(String topic) Remove the replication clusters for the topic.Remove the replication clusters for the topic asynchronously.void
Deprecated.UseTopicPolicies.removeReplicatorDispatchRate(String)
instead.Deprecated.void
removeRetention
(String topic) Deprecated.UseTopicPolicies.removeRetention(String)
instead.removeRetentionAsync
(String topic) Deprecated.UseTopicPolicies.removeRetentionAsync(String)
instead.void
removeSubscribeRate
(String topic) Deprecated.UseTopicPolicies.removeSubscribeRate(String)
instead.removeSubscribeRateAsync
(String topic) Deprecated.UseTopicPolicies.removeSubscribeRateAsync(String)
instead.void
Deprecated.UseTopicPolicies.removeSubscriptionDispatchRate(String)
instead.Deprecated.void
Deprecated.UseTopicPolicies.removeSubscriptionTypesEnabled(String)
instead.Deprecated.void
resetCursor
(String topic, String subName, long timestamp) Reset cursor position on a topic subscription.void
resetCursor
(String topic, String subName, org.apache.pulsar.client.api.MessageId messageId) Reset cursor position on a topic subscription.void
resetCursor
(String topic, String subName, org.apache.pulsar.client.api.MessageId messageId, boolean isExcluded) Reset cursor position on a topic subscription.resetCursorAsync
(String topic, String subName, long timestamp) Reset cursor position on a topic subscription.resetCursorAsync
(String topic, String subName, org.apache.pulsar.client.api.MessageId messageId) Reset cursor position on a topic subscription.resetCursorAsync
(String topic, String subName, org.apache.pulsar.client.api.MessageId messageId, boolean isExcluded) Reset cursor position on a topic subscription.void
revokePermissions
(String topic, String role) Revoke permissions on a topic.revokePermissionsAsync
(String topic, String role) Revoke permissions on a topic asynchronously.default void
setBacklogQuota
(String topic, BacklogQuota backlogQuota) Deprecated.UseTopicPolicies.setBacklogQuota(String, BacklogQuota)
instead.void
setBacklogQuota
(String topic, BacklogQuota backlogQuota, BacklogQuota.BacklogQuotaType backlogQuotaType) Deprecated.void
setCompactionThreshold
(String topic, long compactionThreshold) Deprecated.UseTopicPolicies.setCompactionThreshold(String, long)
instead.setCompactionThresholdAsync
(String topic, long compactionThreshold) Deprecated.void
setDeduplicationSnapshotInterval
(String topic, int interval) Deprecated.setDeduplicationSnapshotIntervalAsync
(String topic, int interval) Deprecated.void
setDeduplicationStatus
(String topic, boolean enabled) Deprecated.setDeduplicationStatusAsync
(String topic, boolean enabled) Deprecated.void
setDelayedDeliveryPolicy
(String topic, DelayedDeliveryPolicies delayedDeliveryPolicies) Deprecated.setDelayedDeliveryPolicyAsync
(String topic, DelayedDeliveryPolicies delayedDeliveryPolicies) Deprecated.void
setDispatchRate
(String topic, DispatchRate dispatchRate) Deprecated.UseTopicPolicies.setDispatchRate(String, DispatchRate)
instead.setDispatchRateAsync
(String topic, DispatchRate dispatchRate) Deprecated.void
setInactiveTopicPolicies
(String topic, InactiveTopicPolicies inactiveTopicPolicies) Deprecated.setInactiveTopicPoliciesAsync
(String topic, InactiveTopicPolicies inactiveTopicPolicies) Deprecated.void
setMaxConsumers
(String topic, int maxConsumers) Deprecated.UseTopicPolicies.setMaxConsumers(String, int)
instead.setMaxConsumersAsync
(String topic, int maxConsumers) Deprecated.UseTopicPolicies.setMaxConsumers(String, int)
instead.void
setMaxConsumersPerSubscription
(String topic, int maxConsumersPerSubscription) Deprecated.setMaxConsumersPerSubscriptionAsync
(String topic, int maxConsumersPerSubscription) Deprecated.void
setMaxMessageSize
(String topic, int maxMessageSize) Deprecated.UseTopicPolicies.setMaxMessageSize(String, int)
instead.setMaxMessageSizeAsync
(String topic, int maxMessageSize) Deprecated.UseTopicPolicies.setMaxMessageSizeAsync(String, int)
instead.void
setMaxProducers
(String topic, int maxProducers) Deprecated.UseTopicPolicies.setMaxProducers(String, int)
instead.setMaxProducersAsync
(String topic, int maxProducers) Deprecated.UseTopicPolicies.setMaxProducersAsync(String, int)
instead.void
setMaxSubscriptionsPerTopic
(String topic, int maxSubscriptionsPerTopic) Deprecated.setMaxSubscriptionsPerTopicAsync
(String topic, int maxSubscriptionsPerTopic) Deprecated.void
setMaxUnackedMessagesOnConsumer
(String topic, int maxNum) Deprecated.setMaxUnackedMessagesOnConsumerAsync
(String topic, int maxNum) Deprecated.void
setMaxUnackedMessagesOnSubscription
(String topic, int maxNum) Deprecated.setMaxUnackedMessagesOnSubscriptionAsync
(String topic, int maxNum) Deprecated.void
setMessageTTL
(String topic, int messageTTLInSecond) Deprecated.UseTopicPolicies.setMessageTTL(String, int)
instead.void
setOffloadPolicies
(String topic, OffloadPolicies offloadPolicies) Deprecated.setOffloadPoliciesAsync
(String topic, OffloadPolicies offloadPolicies) Deprecated.void
setPersistence
(String topic, PersistencePolicies persistencePolicies) Deprecated.UseTopicPolicies.setPersistence(String, PersistencePolicies)
(String)} instead.setPersistenceAsync
(String topic, PersistencePolicies persistencePolicies) Deprecated.UseTopicPolicies.setPersistenceAsync(String, PersistencePolicies)
(String)} instead.void
setPublishRate
(String topic, PublishRate publishMsgRate) Deprecated.UseTopicPolicies.setPublishRate(String, PublishRate)
instead.setPublishRateAsync
(String topic, PublishRate publishMsgRate) Deprecated.void
setReplicatedSubscriptionStatus
(String topic, String subName, boolean enabled) Enable or disable a replicated subscription on a topic.setReplicatedSubscriptionStatusAsync
(String topic, String subName, boolean enabled) Enable or disable a replicated subscription on a topic asynchronously.void
setReplicationClusters
(String topic, List<String> clusterIds) Set the replication clusters for the topic.setReplicationClustersAsync
(String topic, List<String> clusterIds) Set the replication clusters for the topic asynchronously.void
setReplicatorDispatchRate
(String topic, DispatchRate dispatchRate) Deprecated.setReplicatorDispatchRateAsync
(String topic, DispatchRate dispatchRate) Deprecated.void
setRetention
(String topic, RetentionPolicies retention) Deprecated.setRetentionAsync
(String topic, RetentionPolicies retention) Deprecated.void
setSchemaValidationEnforced
(String topic, boolean enable) Get schema validation enforced for a topic.setSchemaValidationEnforcedAsync
(String topic, boolean enable) Get schema validation enforced for a topic asynchronously.void
setSubscribeRate
(String topic, SubscribeRate subscribeRate) Deprecated.setSubscribeRateAsync
(String topic, SubscribeRate subscribeRate) Deprecated.void
setSubscriptionDispatchRate
(String topic, DispatchRate dispatchRate) Deprecated.setSubscriptionDispatchRateAsync
(String topic, DispatchRate dispatchRate) Deprecated.void
setSubscriptionTypesEnabled
(String topic, Set<org.apache.pulsar.client.api.SubscriptionType> subscriptionTypesEnabled) Deprecated.setSubscriptionTypesEnabledAsync
(String topic, Set<org.apache.pulsar.client.api.SubscriptionType> subscriptionTypesEnabled) Deprecated.void
skipAllMessages
(String topic, String subName) Skip all messages on a topic subscription.skipAllMessagesAsync
(String topic, String subName) Skip all messages on a topic subscription asynchronously.void
skipMessages
(String topic, String subName, long numMessages) Skip messages on a topic subscription.skipMessagesAsync
(String topic, String subName, long numMessages) Skip messages on a topic subscription asynchronously.terminatePartitionedTopic
(String topic) Terminate the partitioned topic and prevent any more messages being published on it.CompletableFuture<Map<Integer,
org.apache.pulsar.client.api.MessageId>> Terminate the partitioned topic and prevent any more messages being published on it.org.apache.pulsar.client.api.MessageId
terminateTopic
(String topic) Terminate the topic and prevent any more messages being published on it.CompletableFuture<org.apache.pulsar.client.api.MessageId>
terminateTopicAsync
(String topic) Terminate the topic and prevent any more messages being published on it.void
triggerCompaction
(String topic) Trigger compaction to run for a topic.triggerCompactionAsync
(String topic) Trigger compaction to run for a topic asynchronously.void
triggerOffload
(String topic, org.apache.pulsar.client.api.MessageId messageId) Trigger offloading messages in topic to longterm storage.triggerOffloadAsync
(String topic, org.apache.pulsar.client.api.MessageId messageId) Trigger offloading messages in topic to longterm storage asynchronously.void
Truncate a topic.truncateAsync
(String topic) Truncate a topic asynchronously.void
Unload a topic.unloadAsync
(String topic) Unload a topic asynchronously.void
updatePartitionedTopic
(String topic, int numPartitions) Update number of partitions of a non-global partitioned topic.void
updatePartitionedTopic
(String topic, int numPartitions, boolean updateLocalTopicOnly) Update number of partitions of a non-global partitioned topic.void
updatePartitionedTopic
(String topic, int numPartitions, boolean updateLocalTopicOnly, boolean force) Update number of partitions of a non-global partitioned topic.updatePartitionedTopicAsync
(String topic, int numPartitions) Update number of partitions of a non-global partitioned topic asynchronously.updatePartitionedTopicAsync
(String topic, int numPartitions, boolean updateLocalTopicOnly) Update number of partitions of a non-global partitioned topic asynchronously.updatePartitionedTopicAsync
(String topic, int numPartitions, boolean updateLocalTopicOnly, boolean force) Update number of partitions of a non-global partitioned topic asynchronously.void
updateSubscriptionProperties
(String topic, String subName, Map<String, String> subscriptionProperties) Update Subscription Properties on a topic subscription.updateSubscriptionPropertiesAsync
(String topic, String subName, Map<String, String> subscriptionProperties) Update Subscription Properties on a topic subscription.
-
Method Details
-
getList
Get the both persistent and non-persistent topics under a namespace. Response example:["topic://my-tenant/my-namespace/topic-1", "topic://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace name- Returns:
- a list of topics
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getList
Get the list of topics under a namespace. Response example:["topic://my-tenant/my-namespace/topic-1", "topic://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace nametopicDomain
- useTopicDomain.persistent
to get persistent topics useTopicDomain.non_persistent
to get non-persistent topics Use null to get both persistent and non-persistent topics- Returns:
- a list of topics
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getList
@Deprecated List<String> getList(String namespace, TopicDomain topicDomain, Map<Topics.QueryParam, Object> params) throws PulsarAdminExceptionDeprecated.usegetList(String, TopicDomain, ListTopicsOptions)
instead.- Throws:
PulsarAdminException
-
getList
List<String> getList(String namespace, TopicDomain topicDomain, ListTopicsOptions options) throws PulsarAdminException Get the list of topics under a namespace. Response example:["topic://my-tenant/my-namespace/topic-1", "topic://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace nametopicDomain
- useTopicDomain.persistent
to get persistent topics useTopicDomain.non_persistent
to get non-persistent topics Use null to get both persistent and non-persistent topicsoptions
- params to query the topics- Returns:
- a list of topics
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getListAsync
Get both persistent and non-persistent topics under a namespace asynchronously. Response example:["topic://my-tenant/my-namespace/topic-1", "topic://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace name- Returns:
- a list of topics
-
getListAsync
Get the list of topics under a namespace asynchronously. Response example:["topic://my-tenant/my-namespace/topic-1", "topic://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace nametopicDomain
- useTopicDomain.persistent
to get persistent topics useTopicDomain.non_persistent
to get non-persistent topics Use null to get both persistent and non-persistent topics- Returns:
- a list of topics
-
getListAsync
@Deprecated CompletableFuture<List<String>> getListAsync(String namespace, TopicDomain topicDomain, Map<Topics.QueryParam, Object> params) Deprecated.usegetListAsync(String, TopicDomain, ListTopicsOptions)
instead. -
getListAsync
CompletableFuture<List<String>> getListAsync(String namespace, TopicDomain topicDomain, ListTopicsOptions options) Get the list of topics under a namespace asynchronously. Response example:["topic://my-tenant/my-namespace/topic-1", "topic://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace nametopicDomain
- useTopicDomain.persistent
to get persistent topics useTopicDomain.non_persistent
to get non-persistent topics Use null to get both persistent and non-persistent topicsoptions
- params to get the topics- Returns:
- a list of topics
-
getPartitionedTopicList
Get the list of partitioned topics under a namespace. Response example:["persistent://my-tenant/my-namespace/topic-1", "persistent://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace name- Returns:
- a list of partitioned topics
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getPartitionedTopicListAsync
Get the list of partitioned topics under a namespace asynchronously. Response example:["persistent://my-tenant/my-namespace/topic-1", "persistent://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace name- Returns:
- a list of partitioned topics
-
getPartitionedTopicList
List<String> getPartitionedTopicList(String namespace, ListTopicsOptions options) throws PulsarAdminException Get the list of partitioned topics under a namespace. Response example:["persistent://my-tenant/my-namespace/topic-1", "persistent://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace nameoptions
- params to get the topics- Returns:
- a list of partitioned topics
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getPartitionedTopicListAsync
CompletableFuture<List<String>> getPartitionedTopicListAsync(String namespace, ListTopicsOptions options) Get the list of partitioned topics under a namespace asynchronously. Response example:["persistent://my-tenant/my-namespace/topic-1", "persistent://my-tenant/my-namespace/topic-2"]
- Parameters:
namespace
- Namespace nameoptions
- params to filter the results- Returns:
- a list of partitioned topics
-
getListInBundle
Get list of topics exist into given bundle.- Parameters:
namespace
-bundleRange
-- Returns:
- Throws:
PulsarAdminException
-
getListInBundleAsync
Get list of topics exist into given bundle asynchronously.- Parameters:
namespace
-bundleRange
-- Returns:
-
getPermissions
Get permissions on a topic. Retrieve the effective permissions for a topic. These permissions are defined by the permissions set at the namespace level combined (union) with any eventual specific permission set on the topic. Response Example:{ "role-1" : [ "produce" ], "role-2" : [ "consume" ] }
- Parameters:
topic
- Topic url- Returns:
- a map of topics an their permissions set
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getPermissionsAsync
Get permissions on a topic asynchronously. Retrieve the effective permissions for a topic. These permissions are defined by the permissions set at the namespace level combined (union) with any eventual specific permission set on the topic. Response Example:{ "role-1" : [ "produce" ], "role-2" : [ "consume" ] }
- Parameters:
topic
- Topic url- Returns:
- a map of topics an their permissions set
-
grantPermission
void grantPermission(String topic, String role, Set<AuthAction> actions) throws PulsarAdminException Grant permission on a topic. Grant a new permission to a client role on a single topic. Request parameter example:["produce", "consume"]
- Parameters:
topic
- Topic urlrole
- Client role to which grant permissionactions
- Auth actions (produce and consume)- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException.ConflictException
- Concurrent modificationPulsarAdminException
- Unexpected error
-
grantPermissionAsync
Grant permission on a topic asynchronously. Grant a new permission to a client role on a single topic. Request parameter example:["produce", "consume"]
- Parameters:
topic
- Topic urlrole
- Client role to which grant permissionactions
- Auth actions (produce and consume)
-
revokePermissions
Revoke permissions on a topic. Revoke permissions to a client role on a single topic. If the permission was not set at the topic level, but rather at the namespace level, this operation will return an error (HTTP status code 412).- Parameters:
topic
- Topic urlrole
- Client role to which remove permission- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException.PreconditionFailedException
- Permissions are not set at the topic levelPulsarAdminException
- Unexpected error
-
revokePermissionsAsync
Revoke permissions on a topic asynchronously. Revoke permissions to a client role on a single topic. If the permission was not set at the topic level, but rather at the namespace level, this operation will return an error (HTTP status code 412).- Parameters:
topic
- Topic urlrole
- Client role to which remove permission
-
createPartitionedTopic
Create a partitioned topic. Create a partitioned topic. It needs to be called before creating a producer for a partitioned topic.- Parameters:
topic
- Topic namenumPartitions
- Number of partitions to create of the topic- Throws:
PulsarAdminException
-
createPartitionedTopic
void createPartitionedTopic(String topic, int numPartitions, Map<String, String> properties) throws PulsarAdminExceptionCreate a partitioned topic. Create a partitioned topic. It needs to be called before creating a producer for a partitioned topic.- Parameters:
topic
- Topic namenumPartitions
- Number of partitions to create of the topicproperties
- topic properties- Throws:
PulsarAdminException
-
createPartitionedTopicAsync
Create a partitioned topic asynchronously. Create a partitioned topic asynchronously. It needs to be called before creating a producer for a partitioned topic.- Parameters:
topic
- Topic namenumPartitions
- Number of partitions to create of the topic- Returns:
- a future that can be used to track when the partitioned topic is created
-
createPartitionedTopicAsync
CompletableFuture<Void> createPartitionedTopicAsync(String topic, int numPartitions, Map<String, String> properties) Create a partitioned topic asynchronously. Create a partitioned topic asynchronously. It needs to be called before creating a producer for a partitioned topic.- Parameters:
topic
- Topic namenumPartitions
- Number of partitions to create of the topicproperties
- Topic properties- Returns:
- a future that can be used to track when the partitioned topic is created
-
createNonPartitionedTopic
Create a non-partitioned topic. Create a non-partitioned topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
-
createNonPartitionedTopic
void createNonPartitionedTopic(String topic, Map<String, String> properties) throws PulsarAdminExceptionCreate a non-partitioned topic. Create a non-partitioned topic.- Parameters:
topic
- Topic nameproperties
- Topic properties- Throws:
PulsarAdminException
-
createNonPartitionedTopicAsync
Create a non-partitioned topic asynchronously.- Parameters:
topic
- Topic name
-
createNonPartitionedTopicAsync
Create a non-partitioned topic asynchronously.- Parameters:
topic
- Topic nameproperties
- Topic properties
-
createMissedPartitions
Create missed partitions for partitioned topic. When disable topic auto creation, use this method to try create missed partitions while partitions create failed or users already have partitioned topic without partitions.- Parameters:
topic
- partitioned topic name- Throws:
PulsarAdminException
-
createMissedPartitionsAsync
Create missed partitions for partitioned topic asynchronously. When disable topic auto creation, use this method to try create missed partitions while partitions create failed or users already have partitioned topic without partitions.- Parameters:
topic
- partitioned topic name
-
updatePartitionedTopic
Update number of partitions of a non-global partitioned topic. It requires partitioned-topic to be already exist and number of new partitions must be greater than existing number of partitions. Decrementing number of partitions requires deletion of topic which is not supported.- Parameters:
topic
- Topic namenumPartitions
- Number of new partitions of already exist partitioned-topic- Throws:
PulsarAdminException
-
updatePartitionedTopicAsync
Update number of partitions of a non-global partitioned topic asynchronously. It requires partitioned-topic to be already exist and number of new partitions must be greater than existing number of partitions. Decrementing number of partitions requires deletion of topic which is not supported.- Parameters:
topic
- Topic namenumPartitions
- Number of new partitions of already exist partitioned-topic- Returns:
- a future that can be used to track when the partitioned topic is updated
-
updatePartitionedTopic
void updatePartitionedTopic(String topic, int numPartitions, boolean updateLocalTopicOnly, boolean force) throws PulsarAdminException Update number of partitions of a non-global partitioned topic. It requires partitioned-topic to be already exist and number of new partitions must be greater than existing number of partitions. Decrementing number of partitions requires deletion of topic which is not supported.- Parameters:
topic
- Topic namenumPartitions
- Number of new partitions of already exist partitioned-topicupdateLocalTopicOnly
- Used by broker for global topic with multiple replicated clustersforce
- Update forcefully without validating existing partitioned topic- Throws:
PulsarAdminException
-
updatePartitionedTopicAsync
CompletableFuture<Void> updatePartitionedTopicAsync(String topic, int numPartitions, boolean updateLocalTopicOnly, boolean force) Update number of partitions of a non-global partitioned topic asynchronously. It requires partitioned-topic to be already exist and number of new partitions must be greater than existing number of partitions. Decrementing number of partitions requires deletion of topic which is not supported.- Parameters:
topic
- Topic namenumPartitions
- Number of new partitions of already exist partitioned-topicupdateLocalTopicOnly
- Used by broker for global topic with multiple replicated clustersforce
- Update forcefully without validating existing partitioned topic- Returns:
- a future that can be used to track when the partitioned topic is updated
-
updatePartitionedTopic
void updatePartitionedTopic(String topic, int numPartitions, boolean updateLocalTopicOnly) throws PulsarAdminException Update number of partitions of a non-global partitioned topic. It requires partitioned-topic to be already exist and number of new partitions must be greater than existing number of partitions. Decrementing number of partitions requires deletion of topic which is not supported.- Parameters:
topic
- Topic namenumPartitions
- Number of new partitions of already exist partitioned-topicupdateLocalTopicOnly
- Used by broker for global topic with multiple replicated clusters- Throws:
PulsarAdminException
-
updatePartitionedTopicAsync
CompletableFuture<Void> updatePartitionedTopicAsync(String topic, int numPartitions, boolean updateLocalTopicOnly) Update number of partitions of a non-global partitioned topic asynchronously. It requires partitioned-topic to be already exist and number of new partitions must be greater than existing number of partitions. Decrementing number of partitions requires deletion of topic which is not supported.- Parameters:
topic
- Topic namenumPartitions
- Number of new partitions of already exist partitioned-topicupdateLocalTopicOnly
- Used by broker for global topic with multiple replicated clusters- Returns:
- a future that can be used to track when the partitioned topic is updated
-
getPartitionedTopicMetadata
Get metadata of a partitioned topic. Get metadata of a partitioned topic.- Parameters:
topic
- Topic name- Returns:
- Partitioned topic metadata
- Throws:
PulsarAdminException
-
getPartitionedTopicMetadataAsync
Get metadata of a partitioned topic asynchronously. Get metadata of a partitioned topic asynchronously.- Parameters:
topic
- Topic name- Returns:
- a future that can be used to track when the partitioned topic metadata is returned
-
getProperties
Get properties of a topic.- Parameters:
topic
- Topic name- Returns:
- Topic properties
- Throws:
PulsarAdminException
-
getPropertiesAsync
Get properties of a topic asynchronously.- Parameters:
topic
- Topic name- Returns:
- a future that can be used to track when the topic properties is returned
-
deletePartitionedTopic
@Deprecated void deletePartitionedTopic(String topic, boolean force, boolean deleteSchema) throws PulsarAdminException Deprecated.UsedeletePartitionedTopic(String, boolean)
instead because parameter `deleteSchema` is always trueDelete a partitioned topic and its schemas. It will also delete all the partitions of the topic if it exists.- Parameters:
topic
- Topic nameforce
- Delete topic forcefullydeleteSchema
- Delete topic's schema storage and it is always true even if it is specified as false- Throws:
PulsarAdminException
-
deletePartitionedTopic
- Throws:
PulsarAdminException
- See Also:
-
deletePartitionedTopicAsync
@Deprecated CompletableFuture<Void> deletePartitionedTopicAsync(String topic, boolean force, boolean deleteSchema) Deprecated.UsedeletePartitionedTopicAsync(String, boolean)
instead because parameter `deleteSchema` is always trueDelete a partitioned topic and its schemas asynchronously. It will also delete all the partitions of the topic if it exists.- Parameters:
topic
- Topic nameforce
- Delete topic forcefullydeleteSchema
- Delete topic's schema storage and it is always true even if it is specified as false- Returns:
- a future that can be used to track when the partitioned topic is deleted
-
deletePartitionedTopicAsync
-
deletePartitionedTopic
Delete a partitioned topic. It will also delete all the partitions of the topic if it exists.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
-
deletePartitionedTopicAsync
Delete a partitioned topic asynchronously. It will also delete all the partitions of the topic if it exists.- Parameters:
topic
- Topic name
-
delete
@Deprecated void delete(String topic, boolean force, boolean deleteSchema) throws PulsarAdminException Deprecated.Usedelete(String, boolean)
instead because parameter `deleteSchema` is always trueDelete a topic and its schemas. Delete a topic. The topic cannot be deleted if force flag is disable and there's any active subscription or producer connected to the it. Force flag deletes topic forcefully by closing all active producers and consumers.- Parameters:
topic
- Topic nameforce
- Delete topic forcefullydeleteSchema
- Delete topic's schema storage and it is always true even if it is specified as false- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException.PreconditionFailedException
- Topic has active subscriptions or producersPulsarAdminException
- Unexpected error
-
delete
- Throws:
PulsarAdminException
- See Also:
-
deleteAsync
Deprecated.UsedeleteAsync(String, boolean)
instead because parameter `deleteSchema` is always trueDelete a topic and its schemas asynchronously. Delete a topic asynchronously. The topic cannot be deleted if force flag is disable and there's any active subscription or producer connected to the it. Force flag deletes topic forcefully by closing all active producers and consumers.- Parameters:
topic
- topic nameforce
- Delete topic forcefullydeleteSchema
- Delete topic's schema storage and it is always true even if it is specified as false- Returns:
- a future that can be used to track when the topic is deleted
-
deleteAsync
- See Also:
-
delete
Delete a topic. Delete a topic. The topic cannot be deleted if there's any active subscription or producer connected to the it.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException.PreconditionFailedException
- Topic has active subscriptions or producersPulsarAdminException
- Unexpected error
-
deleteAsync
Delete a topic asynchronously. Delete a topic. The topic cannot be deleted if there's any active subscription or producer connected to the it.- Parameters:
topic
- Topic name
-
unload
Unload a topic.- Parameters:
topic
- topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- topic does not existPulsarAdminException
- Unexpected error
-
unloadAsync
Unload a topic asynchronously.- Parameters:
topic
- topic name- Returns:
- a future that can be used to track when the topic is unloaded
-
terminateTopic
Terminate the topic and prevent any more messages being published on it.- Parameters:
topic
- topic name- Returns:
- the message id of the last message that was published in the topic
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- topic does not existPulsarAdminException
- Unexpected error
-
terminateTopicAsync
Terminate the topic and prevent any more messages being published on it.- Parameters:
topic
- topic name- Returns:
- the message id of the last message that was published in the topic
-
terminatePartitionedTopic
Map<Integer,org.apache.pulsar.client.api.MessageId> terminatePartitionedTopic(String topic) throws PulsarAdminException Terminate the partitioned topic and prevent any more messages being published on it.- Parameters:
topic
- topic name- Returns:
- the message id of the last message that was published in the each partition of topic
- Throws:
PulsarAdminException
-
terminatePartitionedTopicAsync
CompletableFuture<Map<Integer,org.apache.pulsar.client.api.MessageId>> terminatePartitionedTopicAsync(String topic) Terminate the partitioned topic and prevent any more messages being published on it.- Parameters:
topic
- topic name- Returns:
- the message id of the last message that was published in the each partition of topic
-
getSubscriptions
Get the list of subscriptions. Get the list of persistent subscriptions for a given topic.- Parameters:
topic
- topic name- Returns:
- the list of subscriptions
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getSubscriptionsAsync
Get the list of subscriptions asynchronously. Get the list of persistent subscriptions for a given topic.- Parameters:
topic
- topic name- Returns:
- a future that can be used to track when the list of subscriptions is returned
-
getStats
Get the stats for the topic. Response Example:{ "msgRateIn" : 100.0, // Total rate of messages published on the topic. msg/s "msgThroughputIn" : 10240.0, // Total throughput of messages published on the topic. byte/s "msgRateOut" : 100.0, // Total rate of messages delivered on the topic. msg/s "msgThroughputOut" : 10240.0, // Total throughput of messages delivered on the topic. byte/s "averageMsgSize" : 1024.0, // Average size of published messages. bytes "publishers" : [ // List of publishes on this topic with their stats { "producerId" : 10 // producer id "address" : 10.4.1.23:3425 // IP and port for this producer "connectedSince" : 2014-11-21 23:54:46 // Timestamp of this published connection "msgRateIn" : 100.0, // Total rate of messages published by this producer. msg/s "msgThroughputIn" : 10240.0, // Total throughput of messages published by this producer. byte/s "averageMsgSize" : 1024.0, // Average size of published messages by this producer. bytes }, ], "subscriptions" : { // Map of subscriptions on this topic "sub1" : { "msgRateOut" : 100.0, // Total rate of messages delivered on this subscription. msg/s "msgThroughputOut" : 10240.0, // Total throughput delivered on this subscription. bytes/s "msgBacklog" : 0, // Number of messages in the subscriotion backlog "type" : Exclusive // Whether the subscription is exclusive or shared "consumers" [ // List of consumers on this subscription { "id" : 5 // Consumer id "address" : 10.4.1.23:3425 // IP and port for this consumer "connectedSince" : 2014-11-21 23:54:46 // Timestamp of this consumer connection "msgRateOut" : 100.0, // Total rate of messages delivered to this consumer. msg/s "msgThroughputOut" : 10240.0, // Total throughput delivered to this consumer. bytes/s } ], }, "replication" : { // Replication statistics "cluster_1" : { // Cluster name in the context of from-cluster or to-cluster "msgRateIn" : 100.0, // Total rate of messages received from this remote cluster. msg/s "msgThroughputIn" : 10240.0, // Total throughput received from this remote cluster. bytes/s "msgRateOut" : 100.0, // Total rate of messages delivered to the replication-subscriber. msg/s "msgThroughputOut" : 10240.0, // Total throughput delivered to the replication-subscriber. bytes/s "replicationBacklog" : 0, // Number of messages pending to be replicated to this remote cluster "connected" : true, // Whether the replication-subscriber is currently connected locally }, "cluster_2" : { "msgRateIn" : 100.0, "msgThroughputIn" : 10240.0, "msgRateOut" : 100.0, "msgThroughputOut" : 10240.0, "replicationBacklog" : 0, "connected" : true, } }, }
All the rates are computed over a 1 minute window and are relative the last completed 1 minute period.
- Parameters:
topic
- topic namegetStatsOptions
- get stats options- Returns:
- the topic statistics
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getStats
default TopicStats getStats(String topic, boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) throws PulsarAdminException - Throws:
PulsarAdminException
-
getStats
default TopicStats getStats(String topic, boolean getPreciseBacklog, boolean subscriptionBacklogSize) throws PulsarAdminException - Throws:
PulsarAdminException
-
getStats
- Throws:
PulsarAdminException
-
getStats
- Throws:
PulsarAdminException
-
getStatsAsync
CompletableFuture<TopicStats> getStatsAsync(String topic, boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) Get the stats for the topic asynchronously. All the rates are computed over a 1 minute window and are relative the last completed 1 minute period.- Parameters:
topic
- topic namegetPreciseBacklog
- Set to true to get precise backlog, Otherwise get imprecise backlog.subscriptionBacklogSize
- Whether to get backlog size for each subscription.getEarliestTimeInBacklog
- Whether to get the earliest time in backlog.- Returns:
- a future that can be used to track when the topic statistics are returned
-
getStatsAsync
-
getInternalStats
PersistentTopicInternalStats getInternalStats(String topic, boolean metadata) throws PulsarAdminException Get the internal stats for the topic. Access the internal state of the topic- Parameters:
topic
- topic namemetadata
- flag to include ledger metadata- Returns:
- the topic statistics
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getInternalStats
Get the internal stats for the topic. Access the internal state of the topic- Parameters:
topic
- topic name- Returns:
- the topic statistics
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getInternalStatsAsync
CompletableFuture<PersistentTopicInternalStats> getInternalStatsAsync(String topic, boolean metadata) Get the internal stats for the topic asynchronously.- Parameters:
topic
- topic Namemetadata
- flag to include ledger metadata- Returns:
- a future that can be used to track when the internal topic statistics are returned
-
getInternalStatsAsync
Get the internal stats for the topic asynchronously.- Parameters:
topic
- topic Name- Returns:
- a future that can be used to track when the internal topic statistics are returned
-
getInternalInfo
Get a JSON representation of the topic metadata stored in ZooKeeper.- Parameters:
topic
- topic name- Returns:
- the topic internal metadata
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getInternalInfoAsync
Get a JSON representation of the topic metadata stored in ZooKeeper.- Parameters:
topic
- topic name- Returns:
- a future to receive the topic internal metadata
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getPartitionedStats
PartitionedTopicStats getPartitionedStats(String topic, boolean perPartition, boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) throws PulsarAdminException Get the stats for the partitioned topic Response Example:{ "msgRateIn" : 100.0, // Total rate of messages published on the partitioned topic. msg/s "msgThroughputIn" : 10240.0, // Total throughput of messages published on the partitioned topic. byte/s "msgRateOut" : 100.0, // Total rate of messages delivered on the partitioned topic. msg/s "msgThroughputOut" : 10240.0, // Total throughput of messages delivered on the partitioned topic. byte/s "averageMsgSize" : 1024.0, // Average size of published messages. bytes "publishers" : [ // List of publishes on this partitioned topic with their stats { "msgRateIn" : 100.0, // Total rate of messages published by this producer. msg/s "msgThroughputIn" : 10240.0, // Total throughput of messages published by this producer. byte/s "averageMsgSize" : 1024.0, // Average size of published messages by this producer. bytes }, ], "subscriptions" : { // Map of subscriptions on this topic "sub1" : { "msgRateOut" : 100.0, // Total rate of messages delivered on this subscription. msg/s "msgThroughputOut" : 10240.0, // Total throughput delivered on this subscription. bytes/s "msgBacklog" : 0, // Number of messages in the subscriotion backlog "type" : Exclusive // Whether the subscription is exclusive or shared "consumers" [ // List of consumers on this subscription { "msgRateOut" : 100.0, // Total rate of messages delivered to this consumer. msg/s "msgThroughputOut" : 10240.0, // Total throughput delivered to this consumer. bytes/s } ], }, "replication" : { // Replication statistics "cluster_1" : { // Cluster name in the context of from-cluster or to-cluster "msgRateIn" : 100.0, // Total rate of messages received from this remote cluster. msg/s "msgThroughputIn" : 10240.0, // Total throughput received from this remote cluster. bytes/s "msgRateOut" : 100.0, // Total rate of messages delivered to the replication-subscriber. msg/s "msgThroughputOut" : 10240.0, // Total throughput delivered to the replication-subscriber. bytes/s "replicationBacklog" : 0, // Number of messages pending to be replicated to this remote cluster "connected" : true, // Whether the replication-subscriber is currently connected locally }, "cluster_2" : { "msgRateIn" : 100.0, "msgThroughputIn" : 10240.0, "msgRateOut" : 100.0, "msghroughputOut" : 10240.0, "replicationBacklog" : 0, "connected" : true, } }, }
All the rates are computed over a 1 minute window and are relative the last completed 1 minute period.
- Parameters:
topic
- topic nameperPartition
- flag to get stats per partitiongetPreciseBacklog
- Set to true to get precise backlog, Otherwise get imprecise backlog.subscriptionBacklogSize
- Whether to get backlog size for each subscription.- Returns:
- the partitioned topic statistics
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getPartitionedStats
default PartitionedTopicStats getPartitionedStats(String topic, boolean perPartition) throws PulsarAdminException - Throws:
PulsarAdminException
-
getPartitionedStatsAsync
CompletableFuture<PartitionedTopicStats> getPartitionedStatsAsync(String topic, boolean perPartition, boolean getPreciseBacklog, boolean subscriptionBacklogSize, boolean getEarliestTimeInBacklog) Get the stats for the partitioned topic asynchronously.- Parameters:
topic
- topic NameperPartition
- flag to get stats per partitiongetPreciseBacklog
- Set to true to get precise backlog, Otherwise get imprecise backlog.subscriptionBacklogSize
- Whether to get backlog size for each subscription.- Returns:
- a future that can be used to track when the partitioned topic statistics are returned
-
getPartitionedStatsAsync
default CompletableFuture<PartitionedTopicStats> getPartitionedStatsAsync(String topic, boolean perPartition) -
getPartitionedInternalStats
Get the stats for the partitioned topic.- Parameters:
topic
- topic name- Returns:
- Throws:
PulsarAdminException
-
getPartitionedInternalStatsAsync
Get the stats-internal for the partitioned topic asynchronously.- Parameters:
topic
- topic Name- Returns:
- a future that can be used to track when the partitioned topic statistics are returned
-
deleteSubscription
Delete a subscription. Delete a persistent subscription from a topic. There should not be any active consumers on the subscription.- Parameters:
topic
- topic namesubName
- Subscription name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic or subscription does not existPulsarAdminException.PreconditionFailedException
- Subscription has active consumersPulsarAdminException
- Unexpected error
-
deleteSubscription
Delete a subscription. Delete a persistent subscription from a topic. There should not be any active consumers on the subscription. Force flag deletes subscription forcefully by closing all active consumers.- Parameters:
topic
- topic namesubName
- Subscription nameforce
- Delete topic forcefully- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic or subscription does not existPulsarAdminException.PreconditionFailedException
- Subscription has active consumersPulsarAdminException
- Unexpected error
-
deleteSubscriptionAsync
Delete a subscription asynchronously. Delete a persistent subscription from a topic. There should not be any active consumers on the subscription.- Parameters:
topic
- topic namesubName
- Subscription name- Returns:
- a future that can be used to track when the subscription is deleted
-
deleteSubscriptionAsync
Delete a subscription asynchronously. Delete a persistent subscription from a topic. There should not be any active consumers on the subscription. Force flag deletes subscription forcefully by closing all active consumers.- Parameters:
topic
- topic namesubName
- Subscription nameforce
- Delete topic forcefully- Returns:
- a future that can be used to track when the subscription is deleted
-
skipAllMessages
Skip all messages on a topic subscription. Completely clears the backlog on the subscription.- Parameters:
topic
- topic namesubName
- Subscription name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic or subscription does not existPulsarAdminException
- Unexpected error
-
skipAllMessagesAsync
Skip all messages on a topic subscription asynchronously. Completely clears the backlog on the subscription.- Parameters:
topic
- topic namesubName
- Subscription name- Returns:
- a future that can be used to track when all the messages are skipped
-
skipMessages
Skip messages on a topic subscription.- Parameters:
topic
- topic namesubName
- Subscription namenumMessages
- Number of messages- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic or subscription does not existPulsarAdminException
- Unexpected error
-
skipMessagesAsync
Skip messages on a topic subscription asynchronously.- Parameters:
topic
- topic namesubName
- Subscription namenumMessages
- Number of messages- Returns:
- a future that can be used to track when the number of messages are skipped
-
expireMessages
void expireMessages(String topic, String subscriptionName, long expireTimeInSeconds) throws PulsarAdminException Expire all messages older than given N (expireTimeInSeconds) seconds for a given subscription.- Parameters:
topic
- topic namesubscriptionName
- Subscription nameexpireTimeInSeconds
- Expire messages older than time in seconds- Throws:
PulsarAdminException
- Unexpected error
-
expireMessagesAsync
CompletableFuture<Void> expireMessagesAsync(String topic, String subscriptionName, long expireTimeInSeconds) Expire all messages older than given N (expireTimeInSeconds) seconds for a given subscription asynchronously.- Parameters:
topic
- topic namesubscriptionName
- Subscription nameexpireTimeInSeconds
- Expire messages older than time in seconds- Returns:
-
expireMessages
void expireMessages(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean isExcluded) throws PulsarAdminException Expire all messages older than given N (expireTimeInSeconds) seconds for a given subscription.- Parameters:
topic
- topic namesubscriptionName
- Subscription namemessageId
- Position before which all messages will be expired.isExcluded
- Will message at passed in position also be expired.- Throws:
PulsarAdminException
- Unexpected error
-
expireMessagesAsync
CompletableFuture<Void> expireMessagesAsync(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean isExcluded) Expire all messages older than given N (expireTimeInSeconds) seconds for a given subscription asynchronously.- Parameters:
topic
- topic namesubscriptionName
- Subscription namemessageId
- Position before which all messages will be expired.isExcluded
- Will message at passed in position also be expired.- Returns:
- A
CompletableFuture
that'll be completed when expire message is done.
-
expireMessagesForAllSubscriptions
void expireMessagesForAllSubscriptions(String topic, long expireTimeInSeconds) throws PulsarAdminException Expire all messages older than given N seconds for all subscriptions of the persistent-topic.- Parameters:
topic
- topic nameexpireTimeInSeconds
- Expire messages older than time in seconds- Throws:
PulsarAdminException
- Unexpected error
-
expireMessagesForAllSubscriptionsAsync
CompletableFuture<Void> expireMessagesForAllSubscriptionsAsync(String topic, long expireTimeInSeconds) Expire all messages older than given N seconds for all subscriptions of the persistent-topic asynchronously.- Parameters:
topic
- topic nameexpireTimeInSeconds
- Expire messages older than time in seconds
-
peekMessages
List<org.apache.pulsar.client.api.Message<byte[]>> peekMessages(String topic, String subName, int numMessages) throws PulsarAdminException Peek messages from a topic subscription.- Parameters:
topic
- topic namesubName
- Subscription namenumMessages
- Number of messages- Returns:
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic or subscription does not existPulsarAdminException
- Unexpected error
-
peekMessagesAsync
CompletableFuture<List<org.apache.pulsar.client.api.Message<byte[]>>> peekMessagesAsync(String topic, String subName, int numMessages) Peek messages from a topic subscription asynchronously.- Parameters:
topic
- topic namesubName
- Subscription namenumMessages
- Number of messages- Returns:
- a future that can be used to track when the messages are returned
-
getMessageById
org.apache.pulsar.client.api.Message<byte[]> getMessageById(String topic, long ledgerId, long entryId) throws PulsarAdminException Get a message by its messageId via a topic subscription.- Parameters:
topic
- Topic nameledgerId
- Ledger identryId
- Entry id- Returns:
- the message indexed by the messageId
- Throws:
PulsarAdminException
- Unexpected error
-
getMessageByIdAsync
CompletableFuture<org.apache.pulsar.client.api.Message<byte[]>> getMessageByIdAsync(String topic, long ledgerId, long entryId) Get a message by its messageId via a topic subscription asynchronously.- Parameters:
topic
- Topic nameledgerId
- Ledger identryId
- Entry id- Returns:
- a future that can be used to track when the message is returned
-
getMessageIdByTimestamp
org.apache.pulsar.client.api.MessageId getMessageIdByTimestamp(String topic, long timestamp) throws PulsarAdminException Get message ID published at or just after this absolute timestamp (in ms).- Parameters:
topic
- Topic nametimestamp
- Timestamp- Returns:
- MessageId
- Throws:
PulsarAdminException
- Unexpected error
-
getMessageIdByTimestampAsync
CompletableFuture<org.apache.pulsar.client.api.MessageId> getMessageIdByTimestampAsync(String topic, long timestamp) Get message ID published at or just after this absolute timestamp (in ms) asynchronously.- Parameters:
topic
- Topic nametimestamp
- Timestamp- Returns:
- a future that can be used to track when the message ID is returned.
-
createSubscription
default void createSubscription(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId) throws PulsarAdminException Create a new subscription on a topic.- Parameters:
topic
- topic namesubscriptionName
- Subscription namemessageId
- TheMessageId
on where to initialize the subscription. It could beMessageId.latest
,MessageId.earliest
or a specific message id.- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.ConflictException
- Subscription already existsPulsarAdminException.NotAllowedException
- Command disallowed for requested resourcePulsarAdminException
- Unexpected error
-
createSubscriptionAsync
default CompletableFuture<Void> createSubscriptionAsync(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId) Create a new subscription on a topic.- Parameters:
topic
- topic namesubscriptionName
- Subscription namemessageId
- TheMessageId
on where to initialize the subscription. It could beMessageId.latest
,MessageId.earliest
or a specific message id.
-
createSubscription
default void createSubscription(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean replicated) throws PulsarAdminException Create a new subscription on a topic.- Parameters:
topic
- topic namesubscriptionName
- Subscription namemessageId
- TheMessageId
on where to initialize the subscription. It could beMessageId.latest
,MessageId.earliest
or a specific message id.replicated
- replicated subscriptions.- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.ConflictException
- Subscription already existsPulsarAdminException.NotAllowedException
- Command disallowed for requested resourcePulsarAdminException
- Unexpected error
-
createSubscription
void createSubscription(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean replicated, Map<String, String> properties) throws PulsarAdminExceptionCreate a new subscription on a topic.- Parameters:
topic
- topic namesubscriptionName
- Subscription namemessageId
- TheMessageId
on where to initialize the subscription. It could beMessageId.latest
,MessageId.earliest
or a specific message id.replicated
- replicated subscriptions.properties
- subscription properties.- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.ConflictException
- Subscription already existsPulsarAdminException.NotAllowedException
- Command disallowed for requested resourcePulsarAdminException
- Unexpected error
-
createSubscriptionAsync
default CompletableFuture<Void> createSubscriptionAsync(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean replicated) Create a new subscription on a topic.- Parameters:
topic
- topic namesubscriptionName
- Subscription namemessageId
- TheMessageId
on where to initialize the subscription. It could beMessageId.latest
,MessageId.earliest
or a specific message id.replicated
- replicated subscriptions.
-
createSubscriptionAsync
CompletableFuture<Void> createSubscriptionAsync(String topic, String subscriptionName, org.apache.pulsar.client.api.MessageId messageId, boolean replicated, Map<String, String> properties) Create a new subscription on a topic.- Parameters:
topic
- topic namesubscriptionName
- Subscription namemessageId
- TheMessageId
on where to initialize the subscription. It could beMessageId.latest
,MessageId.earliest
or a specific message id.replicated
- replicated subscriptions.properties
- subscription properties.
-
resetCursor
Reset cursor position on a topic subscription.- Parameters:
topic
- topic namesubName
- Subscription nametimestamp
- reset subscription to position closest to time in ms since epoch- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic or subscription does not existPulsarAdminException.NotAllowedException
- Command disallowed for requested resourcePulsarAdminException
- Unexpected error
-
resetCursor
void resetCursor(String topic, String subName, org.apache.pulsar.client.api.MessageId messageId, boolean isExcluded) throws PulsarAdminException Reset cursor position on a topic subscription. and start consume messages from the next position of the reset position.- Parameters:
topic
-subName
-messageId
-isExcluded
-- Throws:
PulsarAdminException
-
updateSubscriptionProperties
void updateSubscriptionProperties(String topic, String subName, Map<String, String> subscriptionProperties) throws PulsarAdminExceptionUpdate Subscription Properties on a topic subscription. The new properties will override the existing values, properties that are not passed will be removed.- Parameters:
topic
-subName
-subscriptionProperties
-- Throws:
PulsarAdminException
-
getSubscriptionProperties
Map<String,String> getSubscriptionProperties(String topic, String subName) throws PulsarAdminException Get Subscription Properties on a topic subscription.- Parameters:
topic
-subName
-- Throws:
PulsarAdminException
-
resetCursorAsync
Reset cursor position on a topic subscription.- Parameters:
topic
- topic namesubName
- Subscription nametimestamp
- reset subscription to position closest to time in ms since epoch
-
resetCursorAsync
CompletableFuture<Void> resetCursorAsync(String topic, String subName, org.apache.pulsar.client.api.MessageId messageId, boolean isExcluded) Reset cursor position on a topic subscription. and start consume messages from the next position of the reset position.- Parameters:
topic
-subName
-messageId
-isExcluded
-- Returns:
-
updateSubscriptionPropertiesAsync
CompletableFuture<Void> updateSubscriptionPropertiesAsync(String topic, String subName, Map<String, String> subscriptionProperties) Update Subscription Properties on a topic subscription. The new properties will override the existing values, properties that are not passed will be removed.- Parameters:
topic
-subName
-subscriptionProperties
-
-
getSubscriptionPropertiesAsync
Get Subscription Properties on a topic subscription.- Parameters:
topic
-subName
-
-
resetCursor
void resetCursor(String topic, String subName, org.apache.pulsar.client.api.MessageId messageId) throws PulsarAdminException Reset cursor position on a topic subscription.- Parameters:
topic
- topic namesubName
- Subscription namemessageId
- reset subscription to messageId (or previous nearest messageId if given messageId is not valid)- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic or subscription does not existPulsarAdminException.NotAllowedException
- Command disallowed for requested resourcePulsarAdminException
- Unexpected error
-
resetCursorAsync
CompletableFuture<Void> resetCursorAsync(String topic, String subName, org.apache.pulsar.client.api.MessageId messageId) Reset cursor position on a topic subscription.- Parameters:
topic
- topic namesubName
- Subscription namemessageId
- reset subscription to messageId (or previous nearest messageId if given messageId is not valid)
-
triggerCompaction
Trigger compaction to run for a topic. A single topic can only have one instance of compaction running at any time. Any attempt to trigger another will be met with a ConflictException.- Parameters:
topic
- The topic on which to trigger compaction- Throws:
PulsarAdminException
-
triggerCompactionAsync
Trigger compaction to run for a topic asynchronously.- Parameters:
topic
- The topic on which to trigger compaction
-
compactionStatus
Check the status of an ongoing compaction for a topic.- Parameters:
topic
- The topic whose compaction status we wish to check- Throws:
PulsarAdminException
-
compactionStatusAsync
Check the status of an ongoing compaction for a topic asynchronously.- Parameters:
topic
- The topic whose compaction status we wish to check
-
triggerOffload
void triggerOffload(String topic, org.apache.pulsar.client.api.MessageId messageId) throws PulsarAdminException Trigger offloading messages in topic to longterm storage.- Parameters:
topic
- the topic to offloadmessageId
- ID of maximum message which should be offloaded- Throws:
PulsarAdminException
-
triggerOffloadAsync
CompletableFuture<Void> triggerOffloadAsync(String topic, org.apache.pulsar.client.api.MessageId messageId) Trigger offloading messages in topic to longterm storage asynchronously.- Parameters:
topic
- the topic to offloadmessageId
- ID of maximum message which should be offloaded
-
offloadStatus
Check the status of an ongoing offloading operation for a topic.- Parameters:
topic
- the topic being offloaded- Returns:
- the status of the offload operation
- Throws:
PulsarAdminException
-
offloadStatusAsync
Check the status of an ongoing offloading operation for a topic asynchronously.- Parameters:
topic
- the topic being offloaded- Returns:
- the status of the offload operation
-
getLastMessageId
Get the last commit message Id of a topic.- Parameters:
topic
- the topic name- Returns:
- Throws:
PulsarAdminException
-
getLastMessageIdAsync
Get the last commit message Id of a topic asynchronously.- Parameters:
topic
- the topic name- Returns:
-
getBacklogQuotaMap
@Deprecated Map<BacklogQuota.BacklogQuotaType,BacklogQuota> getBacklogQuotaMap(String topic) throws PulsarAdminException Deprecated.UseTopicPolicies.getBacklogQuotaMap(String)
instead.Get backlog quota map for a topic. Response example:{ "namespace_memory" : { "limit" : "134217728", "policy" : "consumer_backlog_eviction" }, "destination_storage" : { "limit" : "-1", "policy" : "producer_exception" } }
- Parameters:
topic
- Topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Permission deniedPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getBacklogQuotaMap
@Deprecated Map<BacklogQuota.BacklogQuotaType,BacklogQuota> getBacklogQuotaMap(String topic, boolean applied) throws PulsarAdminException Deprecated.UseTopicPolicies.getBacklogQuotaMap(String, boolean)
instead.Get applied backlog quota map for a topic.- Parameters:
topic
-applied
-- Returns:
- Throws:
PulsarAdminException
-
analyzeSubscriptionBacklog
AnalyzeSubscriptionBacklogResult analyzeSubscriptionBacklog(String topic, String subscriptionName, Optional<org.apache.pulsar.client.api.MessageId> startPosition) throws PulsarAdminException Analyze subscription backlog. This is a potentially expensive operation, as it requires to read the messages from storage. This function takes into consideration batch messages and also Subscription filters.- Parameters:
topic
- Topic namesubscriptionName
- the subscriptionstartPosition
- the position to start the scan from (empty means the last processed message)- Returns:
- an accurate analysis of the backlog
- Throws:
PulsarAdminException
- Unexpected error
-
analyzeSubscriptionBacklogAsync
CompletableFuture<AnalyzeSubscriptionBacklogResult> analyzeSubscriptionBacklogAsync(String topic, String subscriptionName, Optional<org.apache.pulsar.client.api.MessageId> startPosition) Analyze subscription backlog. This is a potentially expensive operation, as it requires to read the messages from storage. This function takes into consideration batch messages and also Subscription filters.- Parameters:
topic
- Topic namesubscriptionName
- the subscriptionstartPosition
- the position to start the scan from (empty means the last processed message)- Returns:
- an accurate analysis of the backlog
- Throws:
PulsarAdminException
- Unexpected error
-
getBacklogSizeByMessageId
Long getBacklogSizeByMessageId(String topic, org.apache.pulsar.client.api.MessageId messageId) throws PulsarAdminException Get backlog size by a message ID.- Parameters:
topic
- Topic namemessageId
- message ID- Returns:
- the backlog size from
- Throws:
PulsarAdminException
- Unexpected error
-
getBacklogSizeByMessageIdAsync
CompletableFuture<Long> getBacklogSizeByMessageIdAsync(String topic, org.apache.pulsar.client.api.MessageId messageId) Get backlog size by a message ID asynchronously.- Parameters:
topic
- Topic namemessageId
- message ID- Returns:
- the backlog size from
-
setBacklogQuota
@Deprecated void setBacklogQuota(String topic, BacklogQuota backlogQuota, BacklogQuota.BacklogQuotaType backlogQuotaType) throws PulsarAdminException Deprecated.Set a backlog quota for a topic. The backlog quota can be set on this resource:Request parameter example:
{ "limit" : "134217728", "policy" : "consumer_backlog_eviction" }
- Parameters:
topic
- Topic namebacklogQuota
- the new BacklogQuotabacklogQuotaType
-- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
setBacklogQuota
@Deprecated default void setBacklogQuota(String topic, BacklogQuota backlogQuota) throws PulsarAdminException Deprecated.UseTopicPolicies.setBacklogQuota(String, BacklogQuota)
instead.- Throws:
PulsarAdminException
-
removeBacklogQuota
@Deprecated void removeBacklogQuota(String topic, BacklogQuota.BacklogQuotaType backlogQuotaType) throws PulsarAdminException Deprecated.Remove a backlog quota policy from a topic. The namespace backlog policy will fall back to the default.- Parameters:
topic
- Topic namebacklogQuotaType
-- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
removeBacklogQuota
Deprecated.UseTopicPolicies.removeBacklogQuota(String)
instead.- Throws:
PulsarAdminException
-
getDelayedDeliveryPolicy
@Deprecated DelayedDeliveryPolicies getDelayedDeliveryPolicy(String topic, boolean applied) throws PulsarAdminException Deprecated.Get the delayed delivery policy applied for a specified topic.- Parameters:
topic
-applied
-- Returns:
- Throws:
PulsarAdminException
-
getDelayedDeliveryPolicyAsync
@Deprecated CompletableFuture<DelayedDeliveryPolicies> getDelayedDeliveryPolicyAsync(String topic, boolean applied) Deprecated.Get the delayed delivery policy applied for a specified topic asynchronously.- Parameters:
topic
-applied
-- Returns:
-
getDelayedDeliveryPolicy
@Deprecated DelayedDeliveryPolicies getDelayedDeliveryPolicy(String topic) throws PulsarAdminException Deprecated.UseTopicPolicies.getDelayedDeliveryPolicy(String)
instead.Get the delayed delivery policy for a specified topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getDelayedDeliveryPolicyAsync
Deprecated.UseTopicPolicies.getDelayedDeliveryPolicyAsync(String)
instead.Get the delayed delivery policy for a specified topic asynchronously.- Parameters:
topic
-- Returns:
-
setDelayedDeliveryPolicy
@Deprecated void setDelayedDeliveryPolicy(String topic, DelayedDeliveryPolicies delayedDeliveryPolicies) throws PulsarAdminException Deprecated.Set the delayed delivery policy for a specified topic.- Parameters:
topic
-delayedDeliveryPolicies
-- Throws:
PulsarAdminException
-
setDelayedDeliveryPolicyAsync
@Deprecated CompletableFuture<Void> setDelayedDeliveryPolicyAsync(String topic, DelayedDeliveryPolicies delayedDeliveryPolicies) Deprecated.Set the delayed delivery policy for a specified topic asynchronously.- Parameters:
topic
-delayedDeliveryPolicies
-- Returns:
-
removeDelayedDeliveryPolicyAsync
Deprecated.Remove the delayed delivery policy for a specified topic asynchronously.- Parameters:
topic
-- Returns:
-
removeDelayedDeliveryPolicy
Deprecated.UseTopicPolicies.removeDelayedDeliveryPolicy(String)
instead.Remove the delayed delivery policy for a specified topic.- Parameters:
topic
-- Throws:
PulsarAdminException
-
setMessageTTL
Deprecated.UseTopicPolicies.setMessageTTL(String, int)
instead.Set message TTL for a topic.- Parameters:
topic
- Topic namemessageTTLInSecond
- Message TTL in second.- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getMessageTTL
Deprecated.UseTopicPolicies.getMessageTTL(String)
instead.Get message TTL for a topic.- Parameters:
topic
-- Returns:
- Message TTL in second.
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getMessageTTL
Deprecated.UseTopicPolicies.getMessageTTL(String, boolean)
instead.Get message TTL applied for a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
removeMessageTTL
Deprecated.UseTopicPolicies.removeMessageTTL(String)
instead.Remove message TTL for a topic.- Parameters:
topic
-- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
setRetention
@Deprecated void setRetention(String topic, RetentionPolicies retention) throws PulsarAdminException Deprecated.Set the retention configuration on a topic. Set the retention configuration on a topic. This operation requires Pulsar super-user access. Request parameter example:{ "retentionTimeInMinutes" : 60, // how long to retain messages "retentionSizeInMB" : 1024, // retention backlog limit }
- Parameters:
topic
- Topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException.ConflictException
- Concurrent modificationPulsarAdminException
- Unexpected error
-
setRetentionAsync
Deprecated.Set the retention configuration for all the topics on a topic asynchronously. Set the retention configuration on a topic. This operation requires Pulsar super-user access. Request parameter example:{ "retentionTimeInMinutes" : 60, // how long to retain messages "retentionSizeInMB" : 1024, // retention backlog limit }
- Parameters:
topic
- Topic name
-
getRetention
Deprecated.UseTopicPolicies.getRetention(String)
instead.Get the retention configuration for a topic. Get the retention configuration for a topic. Response example:{ "retentionTimeInMinutes" : 60, // how long to retain messages "retentionSizeInMB" : 1024, // retention backlog limit }
- Parameters:
topic
- Topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException.ConflictException
- Concurrent modificationPulsarAdminException
- Unexpected error
-
getRetentionAsync
Deprecated.UseTopicPolicies.getRetentionAsync(String)
instead.Get the retention configuration for a topic asynchronously. Get the retention configuration for a topic.- Parameters:
topic
- Topic name
-
getRetention
@Deprecated RetentionPolicies getRetention(String topic, boolean applied) throws PulsarAdminException Deprecated.UseTopicPolicies.getRetention(String, boolean)
instead.Get the applied retention configuration for a topic.- Parameters:
topic
-applied
-- Returns:
- Throws:
PulsarAdminException
-
getRetentionAsync
Deprecated.UseTopicPolicies.getRetentionAsync(String, boolean)
instead.Get the applied retention configuration for a topic asynchronously.- Parameters:
topic
-applied
-- Returns:
-
removeRetention
Deprecated.UseTopicPolicies.removeRetention(String)
instead.Remove the retention configuration for all the topics on a topic. Remove the retention configuration on a topic. This operation requires Pulsar super-user access. Request parameter example:- Parameters:
topic
- Topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException.ConflictException
- Concurrent modificationPulsarAdminException
- Unexpected error
-
removeRetentionAsync
Deprecated.UseTopicPolicies.removeRetentionAsync(String)
instead.Remove the retention configuration for all the topics on a topic asynchronously. Remove the retention configuration on a topic. This operation requires Pulsar super-user access. Request parameter example:{ "retentionTimeInMinutes" : 60, // how long to retain messages "retentionSizeInMB" : 1024, // retention backlog limit }
- Parameters:
topic
- Topic name
-
getMaxUnackedMessagesOnConsumer
Deprecated.get max unacked messages on consumer of a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getMaxUnackedMessagesOnConsumerAsync
Deprecated.get max unacked messages on consumer of a topic asynchronously.- Parameters:
topic
-- Returns:
-
getMaxUnackedMessagesOnConsumer
@Deprecated Integer getMaxUnackedMessagesOnConsumer(String topic, boolean applied) throws PulsarAdminException Deprecated.get applied max unacked messages on consumer of a topic.- Parameters:
topic
-applied
-- Returns:
- Throws:
PulsarAdminException
-
getMaxUnackedMessagesOnConsumerAsync
@Deprecated CompletableFuture<Integer> getMaxUnackedMessagesOnConsumerAsync(String topic, boolean applied) Deprecated.get applied max unacked messages on consumer of a topic asynchronously.- Parameters:
topic
-applied
-- Returns:
-
setMaxUnackedMessagesOnConsumer
@Deprecated void setMaxUnackedMessagesOnConsumer(String topic, int maxNum) throws PulsarAdminException Deprecated.set max unacked messages on consumer of a topic.- Parameters:
topic
-maxNum
-- Throws:
PulsarAdminException
-
setMaxUnackedMessagesOnConsumerAsync
Deprecated.set max unacked messages on consumer of a topic asynchronously.- Parameters:
topic
-maxNum
-- Returns:
-
removeMaxUnackedMessagesOnConsumer
Deprecated.remove max unacked messages on consumer of a topic.- Parameters:
topic
-- Throws:
PulsarAdminException
-
removeMaxUnackedMessagesOnConsumerAsync
Deprecated.remove max unacked messages on consumer of a topic asynchronously.- Parameters:
topic
-- Returns:
-
getInactiveTopicPolicies
@Deprecated InactiveTopicPolicies getInactiveTopicPolicies(String topic, boolean applied) throws PulsarAdminException Deprecated.Get inactive topic policies applied for a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getInactiveTopicPoliciesAsync
@Deprecated CompletableFuture<InactiveTopicPolicies> getInactiveTopicPoliciesAsync(String topic, boolean applied) Deprecated.Get inactive topic policies applied for a topic asynchronously.- Parameters:
topic
-applied
-- Returns:
-
getInactiveTopicPolicies
@Deprecated InactiveTopicPolicies getInactiveTopicPolicies(String topic) throws PulsarAdminException Deprecated.UseTopicPolicies.getInactiveTopicPolicies(String)
instead.get inactive topic policies of a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getInactiveTopicPoliciesAsync
Deprecated.UseTopicPolicies.getInactiveTopicPoliciesAsync(String)
instead.get inactive topic policies of a topic asynchronously.- Parameters:
topic
-- Returns:
-
setInactiveTopicPolicies
@Deprecated void setInactiveTopicPolicies(String topic, InactiveTopicPolicies inactiveTopicPolicies) throws PulsarAdminException Deprecated.set inactive topic policies of a topic.- Parameters:
topic
-inactiveTopicPolicies
-- Throws:
PulsarAdminException
-
setInactiveTopicPoliciesAsync
@Deprecated CompletableFuture<Void> setInactiveTopicPoliciesAsync(String topic, InactiveTopicPolicies inactiveTopicPolicies) Deprecated.set inactive topic policies of a topic asynchronously.- Parameters:
topic
-inactiveTopicPolicies
-- Returns:
-
removeInactiveTopicPolicies
Deprecated.UseTopicPolicies.removeInactiveTopicPolicies(String)
instead.remove inactive topic policies of a topic.- Parameters:
topic
-- Throws:
PulsarAdminException
-
removeInactiveTopicPoliciesAsync
Deprecated.remove inactive topic policies of a topic asynchronously.- Parameters:
topic
-- Returns:
-
getOffloadPolicies
Deprecated.UseTopicPolicies.getOffloadPolicies(String)
instead.get offload policies of a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getOffloadPoliciesAsync
Deprecated.UseTopicPolicies.getOffloadPoliciesAsync(String)
instead.get offload policies of a topic asynchronously.- Parameters:
topic
-- Returns:
-
getOffloadPolicies
@Deprecated OffloadPolicies getOffloadPolicies(String topic, boolean applied) throws PulsarAdminException Deprecated.UseTopicPolicies.getOffloadPolicies(String, boolean)
instead.get applied offload policies of a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getOffloadPoliciesAsync
@Deprecated CompletableFuture<OffloadPolicies> getOffloadPoliciesAsync(String topic, boolean applied) Deprecated.get applied offload policies of a topic asynchronously.- Parameters:
topic
-- Returns:
-
setOffloadPolicies
@Deprecated void setOffloadPolicies(String topic, OffloadPolicies offloadPolicies) throws PulsarAdminException Deprecated.set offload policies of a topic.- Parameters:
topic
-offloadPolicies
-- Throws:
PulsarAdminException
-
setOffloadPoliciesAsync
@Deprecated CompletableFuture<Void> setOffloadPoliciesAsync(String topic, OffloadPolicies offloadPolicies) Deprecated.set offload policies of a topic asynchronously.- Parameters:
topic
-offloadPolicies
-- Returns:
-
removeOffloadPolicies
Deprecated.UseTopicPolicies.removeOffloadPolicies(String)
instead.remove offload policies of a topic.- Parameters:
topic
-- Throws:
PulsarAdminException
-
removeOffloadPoliciesAsync
Deprecated.UseTopicPolicies.removeOffloadPoliciesAsync(String)
instead.remove offload policies of a topic asynchronously.- Parameters:
topic
-- Returns:
-
getMaxUnackedMessagesOnSubscription
Deprecated.get max unacked messages on subscription of a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getMaxUnackedMessagesOnSubscriptionAsync
Deprecated.get max unacked messages on subscription of a topic asynchronously.- Parameters:
topic
-- Returns:
-
getMaxUnackedMessagesOnSubscription
@Deprecated Integer getMaxUnackedMessagesOnSubscription(String topic, boolean applied) throws PulsarAdminException Deprecated.get max unacked messages on subscription of a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getMaxUnackedMessagesOnSubscriptionAsync
@Deprecated CompletableFuture<Integer> getMaxUnackedMessagesOnSubscriptionAsync(String topic, boolean applied) Deprecated.get max unacked messages on subscription of a topic asynchronously.- Parameters:
topic
-- Returns:
-
setMaxUnackedMessagesOnSubscription
@Deprecated void setMaxUnackedMessagesOnSubscription(String topic, int maxNum) throws PulsarAdminException Deprecated.set max unacked messages on subscription of a topic.- Parameters:
topic
-maxNum
-- Throws:
PulsarAdminException
-
setMaxUnackedMessagesOnSubscriptionAsync
@Deprecated CompletableFuture<Void> setMaxUnackedMessagesOnSubscriptionAsync(String topic, int maxNum) Deprecated.set max unacked messages on subscription of a topic asynchronously.- Parameters:
topic
-maxNum
-- Returns:
-
removeMaxUnackedMessagesOnSubscription
Deprecated.remove max unacked messages on subscription of a topic.- Parameters:
topic
-- Throws:
PulsarAdminException
-
removeMaxUnackedMessagesOnSubscriptionAsync
Deprecated.remove max unacked messages on subscription of a topic asynchronously.- Parameters:
topic
-- Returns:
-
setPersistence
@Deprecated void setPersistence(String topic, PersistencePolicies persistencePolicies) throws PulsarAdminException Deprecated.UseTopicPolicies.setPersistence(String, PersistencePolicies)
(String)} instead.Set the configuration of persistence policies for specified topic.- Parameters:
topic
- Topic namepersistencePolicies
- Configuration of bookkeeper persistence policies- Throws:
PulsarAdminException
- Unexpected error
-
setPersistenceAsync
@Deprecated CompletableFuture<Void> setPersistenceAsync(String topic, PersistencePolicies persistencePolicies) Deprecated.UseTopicPolicies.setPersistenceAsync(String, PersistencePolicies)
(String)} instead.Set the configuration of persistence policies for specified topic asynchronously.- Parameters:
topic
- Topic namepersistencePolicies
- Configuration of bookkeeper persistence policies
-
getPersistence
Deprecated.UseTopicPolicies.getPersistence(String)
instead.Get the configuration of persistence policies for specified topic.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
getPersistenceAsync
Deprecated.UseTopicPolicies.getPersistenceAsync(String)
instead.Get the configuration of persistence policies for specified topic asynchronously.- Parameters:
topic
- Topic name
-
getPersistence
@Deprecated PersistencePolicies getPersistence(String topic, boolean applied) throws PulsarAdminException Deprecated.UseTopicPolicies.getPersistence(String, boolean)
instead.Get the applied configuration of persistence policies for specified topic.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
getPersistenceAsync
@Deprecated CompletableFuture<PersistencePolicies> getPersistenceAsync(String topic, boolean applied) Deprecated.UseTopicPolicies.getPersistenceAsync(String, boolean)
instead.Get the applied configuration of persistence policies for specified topic asynchronously.- Parameters:
topic
- Topic name
-
removePersistence
Deprecated.UseTopicPolicies.removePersistence(String)
instead.Remove the configuration of persistence policies for specified topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removePersistenceAsync
Deprecated.UseTopicPolicies.removePersistenceAsync(String)
instead.Remove the configuration of persistence policies for specified topic asynchronously.- Parameters:
topic
- Topic name
-
getDeduplicationEnabled
Deprecated.UseTopicPolicies.getDeduplicationStatus(String)
instead.get deduplication enabled of a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getDeduplicationEnabledAsync
Deprecated.UseTopicPolicies.getDeduplicationStatusAsync(String)
instead.get deduplication enabled of a topic asynchronously.- Parameters:
topic
-- Returns:
-
getDeduplicationStatus
Deprecated.UseTopicPolicies.getDeduplicationStatus(String)
instead.get deduplication enabled of a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getDeduplicationStatusAsync
Deprecated.UseTopicPolicies.getDeduplicationStatusAsync(String)
instead.get deduplication enabled of a topic asynchronously.- Parameters:
topic
-- Returns:
-
getDeduplicationStatus
@Deprecated Boolean getDeduplicationStatus(String topic, boolean applied) throws PulsarAdminException Deprecated.get applied deduplication enabled of a topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getDeduplicationStatusAsync
Deprecated.get applied deduplication enabled of a topic asynchronously.- Parameters:
topic
-- Returns:
-
enableDeduplication
Deprecated.set deduplication enabled of a topic.- Parameters:
topic
-enabled
-- Throws:
PulsarAdminException
-
enableDeduplicationAsync
Deprecated.set deduplication enabled of a topic asynchronously.- Parameters:
topic
-enabled
-- Returns:
-
setDeduplicationStatus
Deprecated.set deduplication enabled of a topic.- Parameters:
topic
-enabled
-- Throws:
PulsarAdminException
-
setDeduplicationStatusAsync
Deprecated.set deduplication enabled of a topic asynchronously.- Parameters:
topic
-enabled
-- Returns:
-
disableDeduplication
Deprecated.UseTopicPolicies.removeDeduplicationStatus(String)
instead.remove deduplication enabled of a topic.- Parameters:
topic
-- Throws:
PulsarAdminException
-
disableDeduplicationAsync
Deprecated.UseTopicPolicies.removeDeduplicationStatusAsync(String)
instead.remove deduplication enabled of a topic asynchronously.- Parameters:
topic
-- Returns:
-
removeDeduplicationStatus
Deprecated.UseTopicPolicies.removeDeduplicationStatus(String)
instead.remove deduplication enabled of a topic.- Parameters:
topic
-- Throws:
PulsarAdminException
-
removeDeduplicationStatusAsync
Deprecated.UseTopicPolicies.removeDeduplicationStatusAsync(String)
instead.remove deduplication enabled of a topic asynchronously.- Parameters:
topic
-- Returns:
-
setDispatchRate
@Deprecated void setDispatchRate(String topic, DispatchRate dispatchRate) throws PulsarAdminException Deprecated.UseTopicPolicies.setDispatchRate(String, DispatchRate)
instead.Set message-dispatch-rate (topic can dispatch this many messages per second).- Parameters:
topic
-dispatchRate
- number of messages per second- Throws:
PulsarAdminException
- Unexpected error
-
setDispatchRateAsync
Deprecated.Set message-dispatch-rate asynchronously. topic can dispatch this many messages per second- Parameters:
topic
-dispatchRate
- number of messages per second
-
getDispatchRate
Deprecated.UseTopicPolicies.getDispatchRate(String)
instead.Get message-dispatch-rate (topic can dispatch this many messages per second).- Parameters:
topic
-- Throws:
PulsarAdminException
- Unexpected error
-
getDispatchRateAsync
Deprecated.UseTopicPolicies.getDispatchRateAsync(String)
instead.Get message-dispatch-rate asynchronously. Topic can dispatch this many messages per second.- Parameters:
topic
-
-
getDispatchRate
Deprecated.UseTopicPolicies.getDispatchRate(String, boolean)
instead.Get applied message-dispatch-rate (topic can dispatch this many messages per second).- Parameters:
topic
-- Throws:
PulsarAdminException
- Unexpected error
-
getDispatchRateAsync
Deprecated.UseTopicPolicies.getDispatchRateAsync(String, boolean)
instead.Get applied message-dispatch-rate asynchronously. Topic can dispatch this many messages per second.- Parameters:
topic
-
-
removeDispatchRate
Deprecated.UseTopicPolicies.removeDispatchRate(String)
instead.Remove message-dispatch-rate. Remove topic message dispatch rate- Parameters:
topic
-- Throws:
PulsarAdminException
- unexpected error
-
removeDispatchRateAsync
@Deprecated CompletableFuture<Void> removeDispatchRateAsync(String topic) throws PulsarAdminException Deprecated.UseTopicPolicies.removeDispatchRateAsync(String)
instead.Remove message-dispatch-rate asynchronously. Remove topic message dispatch rate- Parameters:
topic
-- Throws:
PulsarAdminException
- unexpected error
-
setSubscriptionDispatchRate
@Deprecated void setSubscriptionDispatchRate(String topic, DispatchRate dispatchRate) throws PulsarAdminException Deprecated.Set subscription-message-dispatch-rate for the topic. Subscriptions under this namespace can dispatch this many messages per second- Parameters:
topic
-dispatchRate
- number of messages per second- Throws:
PulsarAdminException
- Unexpected error
-
setSubscriptionDispatchRateAsync
@Deprecated CompletableFuture<Void> setSubscriptionDispatchRateAsync(String topic, DispatchRate dispatchRate) Deprecated.Set subscription-message-dispatch-rate for the topic asynchronously. Subscriptions under this namespace can dispatch this many messages per second.- Parameters:
topic
-dispatchRate
- number of messages per second
-
getSubscriptionDispatchRate
@Deprecated DispatchRate getSubscriptionDispatchRate(String namespace, boolean applied) throws PulsarAdminException Deprecated.Get applied subscription-message-dispatch-rate. Subscriptions under this namespace can dispatch this many messages per second.- Parameters:
namespace
-- Throws:
PulsarAdminException
- Unexpected error
-
getSubscriptionDispatchRateAsync
@Deprecated CompletableFuture<DispatchRate> getSubscriptionDispatchRateAsync(String namespace, boolean applied) Deprecated.Get applied subscription-message-dispatch-rate asynchronously. Subscriptions under this namespace can dispatch this many messages per second.- Parameters:
namespace
-
-
getSubscriptionDispatchRate
Deprecated.UseTopicPolicies.getSubscriptionDispatchRate(String)
instead.Get subscription-message-dispatch-rate for the topic. Subscriptions under this namespace can dispatch this many messages per second.- Parameters:
topic
-- Throws:
PulsarAdminException
- Unexpected error
-
getSubscriptionDispatchRateAsync
Deprecated.Get subscription-message-dispatch-rate asynchronously. Subscriptions under this namespace can dispatch this many messages per second.- Parameters:
topic
-
-
removeSubscriptionDispatchRate
Deprecated.UseTopicPolicies.removeSubscriptionDispatchRate(String)
instead.Remove subscription-message-dispatch-rate for a topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removeSubscriptionDispatchRateAsync
Deprecated.Remove subscription-message-dispatch-rate for a topic asynchronously.- Parameters:
topic
- Topic name
-
setReplicatorDispatchRate
@Deprecated void setReplicatorDispatchRate(String topic, DispatchRate dispatchRate) throws PulsarAdminException Deprecated.Set replicatorDispatchRate for the topic. Replicator dispatch rate under this topic can dispatch this many messages per second- Parameters:
topic
-dispatchRate
- number of messages per second- Throws:
PulsarAdminException
- Unexpected error
-
setReplicatorDispatchRateAsync
@Deprecated CompletableFuture<Void> setReplicatorDispatchRateAsync(String topic, DispatchRate dispatchRate) Deprecated.Set replicatorDispatchRate for the topic asynchronously. Replicator dispatch rate under this topic can dispatch this many messages per second.- Parameters:
topic
-dispatchRate
- number of messages per second
-
getReplicatorDispatchRate
Deprecated.UseTopicPolicies.getReplicatorDispatchRate(String)
instead.Get replicatorDispatchRate for the topic. Replicator dispatch rate under this topic can dispatch this many messages per second.- Parameters:
topic
-- Throws:
PulsarAdminException
- Unexpected error
-
getReplicatorDispatchRateAsync
Deprecated.UseTopicPolicies.getReplicatorDispatchRateAsync(String)
instead.Get replicatorDispatchRate asynchronously. Replicator dispatch rate under this topic can dispatch this many messages per second.- Parameters:
topic
-
-
getReplicatorDispatchRate
@Deprecated DispatchRate getReplicatorDispatchRate(String topic, boolean applied) throws PulsarAdminException Deprecated.Get applied replicatorDispatchRate for the topic.- Parameters:
topic
-applied
-- Returns:
- Throws:
PulsarAdminException
-
getReplicatorDispatchRateAsync
@Deprecated CompletableFuture<DispatchRate> getReplicatorDispatchRateAsync(String topic, boolean applied) Deprecated.Get applied replicatorDispatchRate asynchronously.- Parameters:
topic
-applied
-- Returns:
-
removeReplicatorDispatchRate
Deprecated.UseTopicPolicies.removeReplicatorDispatchRate(String)
instead.Remove replicatorDispatchRate for a topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removeReplicatorDispatchRateAsync
Deprecated.Remove replicatorDispatchRate for a topic asynchronously.- Parameters:
topic
- Topic name
-
getCompactionThreshold
Deprecated.UseTopicPolicies.getCompactionThreshold(String)
instead.Get the compactionThreshold for a topic. The maximum number of bytes can have before compaction is triggered. 0 disables. Response example:10000000
- Parameters:
topic
- Topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getCompactionThresholdAsync
Deprecated.UseTopicPolicies.getCompactionThresholdAsync(String)
instead.Get the compactionThreshold for a topic asynchronously. The maximum number of bytes can have before compaction is triggered. 0 disables. Response example:10000000
- Parameters:
topic
- Topic name
-
getCompactionThreshold
Deprecated.Get the compactionThreshold for a topic. The maximum number of bytes can have before compaction is triggered. 0 disables.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getCompactionThresholdAsync
Deprecated.Get the compactionThreshold for a topic asynchronously. The maximum number of bytes can have before compaction is triggered. 0 disables.- Parameters:
topic
- Topic name
-
setCompactionThreshold
@Deprecated void setCompactionThreshold(String topic, long compactionThreshold) throws PulsarAdminException Deprecated.UseTopicPolicies.setCompactionThreshold(String, long)
instead.Set the compactionThreshold for a topic. The maximum number of bytes can have before compaction is triggered. 0 disables. Request example:10000000
- Parameters:
topic
- Topic namecompactionThreshold
- maximum number of backlog bytes before compaction is triggered- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
setCompactionThresholdAsync
@Deprecated CompletableFuture<Void> setCompactionThresholdAsync(String topic, long compactionThreshold) Deprecated.Set the compactionThreshold for a topic asynchronously. The maximum number of bytes can have before compaction is triggered. 0 disables. Request example:10000000
- Parameters:
topic
- Topic namecompactionThreshold
- maximum number of backlog bytes before compaction is triggered
-
removeCompactionThreshold
Deprecated.UseTopicPolicies.removeCompactionThreshold(String)
instead.Remove the compactionThreshold for a topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removeCompactionThresholdAsync
Deprecated.UseTopicPolicies.removeCompactionThresholdAsync(String)
instead.Remove the compactionThreshold for a topic asynchronously.- Parameters:
topic
- Topic name
-
setPublishRate
@Deprecated void setPublishRate(String topic, PublishRate publishMsgRate) throws PulsarAdminException Deprecated.UseTopicPolicies.setPublishRate(String, PublishRate)
instead.Set message-publish-rate (topics can publish this many messages per second).- Parameters:
topic
-publishMsgRate
- number of messages per second- Throws:
PulsarAdminException
- Unexpected error
-
setPublishRateAsync
Deprecated.Set message-publish-rate (topics can publish this many messages per second) asynchronously.- Parameters:
topic
-publishMsgRate
- number of messages per second
-
getPublishRate
Deprecated.UseTopicPolicies.getPublishRate(String)
instead.Get message-publish-rate (topics can publish this many messages per second).- Parameters:
topic
-- Returns:
- number of messages per second
- Throws:
PulsarAdminException
- Unexpected error
-
getPublishRateAsync
Deprecated.UseTopicPolicies.getPublishRateAsync(String)
instead.Get message-publish-rate (topics can publish this many messages per second) asynchronously.- Parameters:
topic
-- Returns:
- number of messages per second
-
removePublishRate
Deprecated.UseTopicPolicies.removePublishRate(String)
instead.Remove message-publish-rate. Remove topic message publish rate- Parameters:
topic
-- Throws:
PulsarAdminException
- unexpected error
-
removePublishRateAsync
@Deprecated CompletableFuture<Void> removePublishRateAsync(String topic) throws PulsarAdminException Deprecated.UseTopicPolicies.removePublishRateAsync(String)
instead.Remove message-publish-rate asynchronously. Remove topic message publish rate- Parameters:
topic
-- Throws:
PulsarAdminException
- unexpected error
-
getMaxConsumersPerSubscription
Deprecated.UseTopicPolicies.getMaxConsumersPerSubscription(String)
instead.Get the maxConsumersPerSubscription for a topic. Response example:0
- Parameters:
topic
- Topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
getMaxConsumersPerSubscriptionAsync
Deprecated.Get the maxConsumersPerSubscription for a topic asynchronously. Response example:0
- Parameters:
topic
- Topic name
-
setMaxConsumersPerSubscription
@Deprecated void setMaxConsumersPerSubscription(String topic, int maxConsumersPerSubscription) throws PulsarAdminException Deprecated.Set maxConsumersPerSubscription for a topic. Request example:10
- Parameters:
topic
- Topic namemaxConsumersPerSubscription
- maxConsumersPerSubscription value for a namespace- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Namespace does not existPulsarAdminException
- Unexpected error
-
setMaxConsumersPerSubscriptionAsync
@Deprecated CompletableFuture<Void> setMaxConsumersPerSubscriptionAsync(String topic, int maxConsumersPerSubscription) Deprecated.Set maxConsumersPerSubscription for a topic asynchronously. Request example:10
- Parameters:
topic
- Topic namemaxConsumersPerSubscription
- maxConsumersPerSubscription value for a namespace
-
removeMaxConsumersPerSubscription
Deprecated.Remove the maxConsumersPerSubscription for a topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removeMaxConsumersPerSubscriptionAsync
Deprecated.Remove the maxConsumersPerSubscription for a topic asynchronously.- Parameters:
topic
- Topic name
-
getMaxProducers
Deprecated.UseTopicPolicies.getMaxProducers(String)
instead.Get the max number of producer for specified topic.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
getMaxProducersAsync
Deprecated.UseTopicPolicies.getMaxProducersAsync(String)
instead.Get the max number of producer for specified topic asynchronously.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
getMaxProducers
Deprecated.UseTopicPolicies.getMaxProducers(String, boolean)
instead.Get the max number of producer applied for specified topic.- Parameters:
topic
-applied
-- Returns:
- Throws:
PulsarAdminException
-
getMaxProducersAsync
Deprecated.UseTopicPolicies.getMaxProducersAsync(String, boolean)
instead.Get the max number of producer applied for specified topic asynchronously.- Parameters:
topic
-applied
-- Returns:
-
setMaxProducers
Deprecated.UseTopicPolicies.setMaxProducers(String, int)
instead.Set the max number of producer for specified topic.- Parameters:
topic
- Topic namemaxProducers
- Max number of producer- Throws:
PulsarAdminException
- Unexpected error
-
setMaxProducersAsync
Deprecated.UseTopicPolicies.setMaxProducersAsync(String, int)
instead.Set the max number of producer for specified topic asynchronously.- Parameters:
topic
- Topic namemaxProducers
- Max number of producer- Throws:
PulsarAdminException
- Unexpected error
-
removeMaxProducers
Deprecated.UseTopicPolicies.removeMaxProducers(String)
instead.Remove the max number of producer for specified topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removeMaxProducersAsync
Deprecated.UseTopicPolicies.removeMaxProducersAsync(String)
instead.Remove the max number of producer for specified topic asynchronously.- Parameters:
topic
- Topic name
-
getMaxSubscriptionsPerTopic
Deprecated.UseTopicPolicies.getMaxSubscriptionsPerTopic(String)
instead.Get the max number of subscriptions for specified topic.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
getMaxSubscriptionsPerTopicAsync
Deprecated.Get the max number of subscriptions for specified topic asynchronously.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
setMaxSubscriptionsPerTopic
@Deprecated void setMaxSubscriptionsPerTopic(String topic, int maxSubscriptionsPerTopic) throws PulsarAdminException Deprecated.Set the max number of subscriptions for specified topic.- Parameters:
topic
- Topic namemaxSubscriptionsPerTopic
- Max number of subscriptions- Throws:
PulsarAdminException
- Unexpected error
-
setMaxSubscriptionsPerTopicAsync
@Deprecated CompletableFuture<Void> setMaxSubscriptionsPerTopicAsync(String topic, int maxSubscriptionsPerTopic) Deprecated.Set the max number of subscriptions for specified topic asynchronously.- Parameters:
topic
- Topic namemaxSubscriptionsPerTopic
- Max number of subscriptions- Throws:
PulsarAdminException
- Unexpected error
-
removeMaxSubscriptionsPerTopic
Deprecated.UseTopicPolicies.removeMaxSubscriptionsPerTopic(String)
instead.Remove the max number of subscriptions for specified topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removeMaxSubscriptionsPerTopicAsync
Deprecated.Remove the max number of subscriptions for specified topic asynchronously.- Parameters:
topic
- Topic name
-
getMaxMessageSize
Deprecated.UseTopicPolicies.getMaxMessageSize(String)
instead.Get the max message size for specified topic.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
getMaxMessageSizeAsync
Deprecated.UseTopicPolicies.getMaxMessageSizeAsync(String)
instead.Get the max message size for specified topic asynchronously.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
setMaxMessageSize
Deprecated.UseTopicPolicies.setMaxMessageSize(String, int)
instead.Set the max message size for specified topic.- Parameters:
topic
- Topic namemaxMessageSize
- Max message size of producer- Throws:
PulsarAdminException
- Unexpected error
-
setMaxMessageSizeAsync
Deprecated.UseTopicPolicies.setMaxMessageSizeAsync(String, int)
instead.Set the max message size for specified topic asynchronously.0 disables.- Parameters:
topic
- Topic namemaxMessageSize
- Max message size of topic- Throws:
PulsarAdminException
- Unexpected error
-
removeMaxMessageSize
Deprecated.UseTopicPolicies.removeMaxMessageSize(String)
instead.Remove the max message size for specified topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removeMaxMessageSizeAsync
Deprecated.UseTopicPolicies.removeMaxMessageSizeAsync(String)
instead.Remove the max message size for specified topic asynchronously.- Parameters:
topic
- Topic name
-
getMaxConsumers
Deprecated.UseTopicPolicies.getMaxConsumers(String)
instead.Get the max number of consumer for specified topic.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
getMaxConsumersAsync
Deprecated.UseTopicPolicies.getMaxConsumersAsync(String)
instead.Get the max number of consumer for specified topic asynchronously.- Parameters:
topic
- Topic name- Returns:
- Configuration of bookkeeper persistence policies
- Throws:
PulsarAdminException
- Unexpected error
-
getMaxConsumers
Deprecated.UseTopicPolicies.getMaxConsumers(String, boolean)
instead.Get the max number of consumer applied for specified topic.- Parameters:
topic
-applied
-- Returns:
- Throws:
PulsarAdminException
-
getMaxConsumersAsync
Deprecated.UseTopicPolicies.getMaxConsumersAsync(String, boolean)
instead.Get the max number of consumer applied for specified topic asynchronously.- Parameters:
topic
-applied
-- Returns:
-
setMaxConsumers
Deprecated.UseTopicPolicies.setMaxConsumers(String, int)
instead.Set the max number of consumer for specified topic.- Parameters:
topic
- Topic namemaxConsumers
- Max number of consumer- Throws:
PulsarAdminException
- Unexpected error
-
setMaxConsumersAsync
Deprecated.UseTopicPolicies.setMaxConsumers(String, int)
instead.Set the max number of consumer for specified topic asynchronously.- Parameters:
topic
- Topic namemaxConsumers
- Max number of consumer- Throws:
PulsarAdminException
- Unexpected error
-
removeMaxConsumers
Deprecated.UseTopicPolicies.removeMaxConsumers(String)
instead.Remove the max number of consumer for specified topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removeMaxConsumersAsync
Deprecated.UseTopicPolicies.removeMaxConsumersAsync(String)
instead.Remove the max number of consumer for specified topic asynchronously.- Parameters:
topic
- Topic name
-
getDeduplicationSnapshotInterval
Deprecated.Get the deduplication snapshot interval for specified topic.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getDeduplicationSnapshotIntervalAsync
Deprecated.Get the deduplication snapshot interval for specified topic asynchronously.- Parameters:
topic
-- Returns:
-
setDeduplicationSnapshotInterval
@Deprecated void setDeduplicationSnapshotInterval(String topic, int interval) throws PulsarAdminException Deprecated.Set the deduplication snapshot interval for specified topic.- Parameters:
topic
-interval
-- Throws:
PulsarAdminException
-
setDeduplicationSnapshotIntervalAsync
@Deprecated CompletableFuture<Void> setDeduplicationSnapshotIntervalAsync(String topic, int interval) Deprecated.Set the deduplication snapshot interval for specified topic asynchronously.- Parameters:
topic
-interval
-- Returns:
-
removeDeduplicationSnapshotInterval
Deprecated.Remove the deduplication snapshot interval for specified topic.- Parameters:
topic
-- Throws:
PulsarAdminException
-
removeDeduplicationSnapshotIntervalAsync
Deprecated.Remove the deduplication snapshot interval for specified topic asynchronously.- Parameters:
topic
-- Returns:
-
setSubscriptionTypesEnabled
@Deprecated void setSubscriptionTypesEnabled(String topic, Set<org.apache.pulsar.client.api.SubscriptionType> subscriptionTypesEnabled) throws PulsarAdminException Deprecated.Set is enable sub types.- Parameters:
topic
-subscriptionTypesEnabled
- is enable subTypes- Throws:
PulsarAdminException
- Unexpected error
-
setSubscriptionTypesEnabledAsync
@Deprecated CompletableFuture<Void> setSubscriptionTypesEnabledAsync(String topic, Set<org.apache.pulsar.client.api.SubscriptionType> subscriptionTypesEnabled) Deprecated.Set is enable sub types asynchronously.- Parameters:
topic
-subscriptionTypesEnabled
- is enable subTypes
-
getSubscriptionTypesEnabled
@Deprecated Set<org.apache.pulsar.client.api.SubscriptionType> getSubscriptionTypesEnabled(String topic) throws PulsarAdminException Deprecated.UseTopicPolicies.getSubscriptionTypesEnabled(String)
instead.Get is enable sub types.- Parameters:
topic
- is topic for get is enable sub types- Returns:
- set of enable sub types
Set<org.apache.pulsar.client.api.SubscriptionType>
- Throws:
PulsarAdminException
- Unexpected error
-
getSubscriptionTypesEnabledAsync
@Deprecated CompletableFuture<Set<org.apache.pulsar.client.api.SubscriptionType>> getSubscriptionTypesEnabledAsync(String topic) Deprecated.Get is enable sub types asynchronously.- Parameters:
topic
- is topic for get is enable sub types
-
removeSubscriptionTypesEnabled
Deprecated.UseTopicPolicies.removeSubscriptionTypesEnabled(String)
instead.Remove subscription types enabled for a topic.- Parameters:
topic
- Topic name- Throws:
PulsarAdminException
- Unexpected error
-
removeSubscriptionTypesEnabledAsync
Deprecated.Remove subscription types enabled for a topic asynchronously.- Parameters:
topic
- Topic name
-
setSubscribeRate
@Deprecated void setSubscribeRate(String topic, SubscribeRate subscribeRate) throws PulsarAdminException Deprecated.Set topic-subscribe-rate (topic will limit by subscribeRate).- Parameters:
topic
-subscribeRate
- consumer subscribe limit by this subscribeRate- Throws:
PulsarAdminException
- Unexpected error
-
setSubscribeRateAsync
@Deprecated CompletableFuture<Void> setSubscribeRateAsync(String topic, SubscribeRate subscribeRate) Deprecated.Set topic-subscribe-rate (topics will limit by subscribeRate) asynchronously.- Parameters:
topic
-subscribeRate
- consumer subscribe limit by this subscribeRate
-
getSubscribeRate
Deprecated.UseTopicPolicies.getSubscribeRate(String)
instead.Get topic-subscribe-rate (topics allow subscribe times per consumer in a period).- Parameters:
topic
-- Throws:
PulsarAdminException
- Unexpected error
-
getSubscribeRateAsync
Deprecated.UseTopicPolicies.getSubscribeRateAsync(String)
instead.Get topic-subscribe-rate asynchronously. Topic allow subscribe times per consumer in a period.- Parameters:
topic
-
-
getSubscribeRate
@Deprecated SubscribeRate getSubscribeRate(String topic, boolean applied) throws PulsarAdminException Deprecated.UseTopicPolicies.getSubscribeRate(String, boolean)
instead.Get applied topic-subscribe-rate (topics allow subscribe times per consumer in a period).- Parameters:
topic
-- Throws:
PulsarAdminException
- Unexpected error
-
getSubscribeRateAsync
Deprecated.UseTopicPolicies.getSubscribeRateAsync(String, boolean)
instead.Get applied topic-subscribe-rate asynchronously.- Parameters:
topic
-
-
removeSubscribeRate
Deprecated.UseTopicPolicies.removeSubscribeRate(String)
instead.Remove topic-subscribe-rate. Remove topic subscribe rate- Parameters:
topic
-- Throws:
PulsarAdminException
- unexpected error
-
removeSubscribeRateAsync
@Deprecated CompletableFuture<Void> removeSubscribeRateAsync(String topic) throws PulsarAdminException Deprecated.UseTopicPolicies.removeSubscribeRateAsync(String)
instead.Remove topic-subscribe-rate asynchronously. Remove topic subscribe rate- Parameters:
topic
-- Throws:
PulsarAdminException
- unexpected error
-
examineMessage
org.apache.pulsar.client.api.Message<byte[]> examineMessage(String topic, String initialPosition, long messagePosition) throws PulsarAdminException Examine a specific message on a topic by position relative to the earliest or the latest message.- Parameters:
topic
- Topic nameinitialPosition
- Relative start position to examine message. It can be 'latest' or 'earliest'messagePosition
- The position of messages (default 1)- Throws:
PulsarAdminException
-
examineMessageAsync
CompletableFuture<org.apache.pulsar.client.api.Message<byte[]>> examineMessageAsync(String topic, String initialPosition, long messagePosition) throws PulsarAdminException Examine a specific message on a topic by position relative to the earliest or the latest message.- Parameters:
topic
- Topic nameinitialPosition
- Relative start position to examine message. It can be 'latest' or 'earliest'messagePosition
- The position of messages (default 1)- Throws:
PulsarAdminException
-
truncate
Truncate a topic.- Parameters:
topic
- topic name- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException
- Unexpected error
-
truncateAsync
Truncate a topic asynchronously. The latest ledger cannot be deleted.- Parameters:
topic
- topic name- Returns:
- a future that can be used to track when the topic is truncated
-
setReplicatedSubscriptionStatus
void setReplicatedSubscriptionStatus(String topic, String subName, boolean enabled) throws PulsarAdminException Enable or disable a replicated subscription on a topic.- Parameters:
topic
-subName
-enabled
-- Throws:
PulsarAdminException
-
setReplicatedSubscriptionStatusAsync
CompletableFuture<Void> setReplicatedSubscriptionStatusAsync(String topic, String subName, boolean enabled) Enable or disable a replicated subscription on a topic asynchronously.- Parameters:
topic
-subName
-enabled
-- Returns:
-
getReplicationClusters
Get the replication clusters for a topic.- Parameters:
topic
-applied
-- Returns:
- Throws:
PulsarAdminException
-
getReplicationClustersAsync
Get the replication clusters for a topic asynchronously.- Parameters:
topic
-applied
-- Returns:
- Throws:
PulsarAdminException
-
setReplicationClusters
Set the replication clusters for the topic.- Parameters:
topic
-clusterIds
-- Throws:
PulsarAdminException
-
setReplicationClustersAsync
Set the replication clusters for the topic asynchronously.- Parameters:
topic
-clusterIds
-- Returns:
- Throws:
PulsarAdminException
-
removeReplicationClusters
Remove the replication clusters for the topic.- Parameters:
topic
-- Throws:
PulsarAdminException
-
removeReplicationClustersAsync
Remove the replication clusters for the topic asynchronously.- Parameters:
topic
-- Returns:
- Throws:
PulsarAdminException
-
getReplicatedSubscriptionStatus
Map<String,Boolean> getReplicatedSubscriptionStatus(String topic, String subName) throws PulsarAdminException Get replicated subscription status on a topic.- Parameters:
topic
- topic namesubName
- subscription name- Returns:
- a map of replicated subscription status on a topic
- Throws:
PulsarAdminException.NotAuthorizedException
- Don't have admin permissionPulsarAdminException.NotFoundException
- Topic does not existPulsarAdminException
- Unexpected error
-
getReplicatedSubscriptionStatusAsync
CompletableFuture<Map<String,Boolean>> getReplicatedSubscriptionStatusAsync(String topic, String subName) Get replicated subscription status on a topic asynchronously.- Parameters:
topic
- topic name- Returns:
- a map of replicated subscription status on a topic
-
getSchemaValidationEnforced
Get schema validation enforced for a topic.- Parameters:
topic
- topic name- Returns:
- whether the schema validation enforced is set or not
- Throws:
PulsarAdminException
-
setSchemaValidationEnforced
Get schema validation enforced for a topic.- Parameters:
topic
- topic name- Throws:
PulsarAdminException
-
getSchemaValidationEnforcedAsync
Get schema validation enforced for a topic asynchronously.- Parameters:
topic
- topic name- Returns:
- whether the schema validation enforced is set or not
-
setSchemaValidationEnforcedAsync
Get schema validation enforced for a topic asynchronously.- Parameters:
topic
- topic name
-
delete(String, boolean)
instead because parameter `deleteSchema` is always true