public class TopicsImpl extends BaseResource implements Topics, PersistentTopics
| Constructor and Description |
|---|
TopicsImpl(javax.ws.rs.client.WebTarget web,
Authentication auth) |
| Modifier and Type | Method and Description |
|---|---|
CompactionStatus |
compactionStatus(String topic)
Check the status of an ongoing compaction for a topic.
|
void |
createPartitionedTopic(String topic,
int numPartitions)
Create a partitioned topic.
|
CompletableFuture<Void> |
createPartitionedTopicAsync(String topic,
int numPartitions)
Create a partitioned topic asynchronously.
|
void |
createSubscription(String topic,
String subscriptionName,
MessageId messageId)
Create a new subscription on a topic
|
CompletableFuture<Void> |
createSubscriptionAsync(String topic,
String subscriptionName,
MessageId messageId)
Create a new subscription on a topic
|
void |
delete(String topic)
Delete a topic.
|
void |
delete(String topic,
boolean force)
Delete a topic.
|
CompletableFuture<Void> |
deleteAsync(String topic,
boolean force)
Delete a topic asynchronously.
|
void |
deletePartitionedTopic(String topic)
Delete a partitioned topic.
|
void |
deletePartitionedTopic(String topic,
boolean force)
Delete a partitioned topic.
|
CompletableFuture<Void> |
deletePartitionedTopicAsync(String topic,
boolean force)
Delete a partitioned topic asynchronously.
|
void |
deleteSubscription(String topic,
String subName)
Delete a subscription.
|
CompletableFuture<Void> |
deleteSubscriptionAsync(String topic,
String subName)
Delete a subscription asynchronously.
|
void |
expireMessages(String topic,
String subName,
long expireTimeInSeconds)
Expire all messages older than given N (expireTimeInSeconds) seconds for a given subscription
|
CompletableFuture<Void> |
expireMessagesAsync(String topic,
String subName,
long expireTimeInSeconds)
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 (expireTimeInSeconds) seconds for all subscriptions of the
persistent-topic
|
CompletableFuture<Void> |
expireMessagesForAllSubscriptionsAsync(String topic,
long expireTimeInSeconds)
Expire all messages older than given N (expireTimeInSeconds) seconds for all subscriptions of the
persistent-topic asynchronously
|
com.google.gson.JsonObject |
getInternalInfo(String topic)
Get a JSON representation of the topic metadata stored in ZooKeeper
|
CompletableFuture<com.google.gson.JsonObject> |
getInternalInfoAsync(String topic)
Get a JSON representation of the topic metadata stored in ZooKeeper
|
PersistentTopicInternalStats |
getInternalStats(String topic)
Get the internal stats for the topic.
|
CompletableFuture<PersistentTopicInternalStats> |
getInternalStatsAsync(String topic)
Get the internal stats for the topic asynchronously.
|
List<String> |
getList(String namespace)
Get the list of topics under a namespace.
|
List<String> |
getListInBundle(String namespace,
String bundleRange)
Get list of topics exist into given bundle
|
CompletableFuture<List<String>> |
getListInBundleAsync(String namespace,
String bundleRange)
Get list of topics exist into given bundle asynchronously.
|
PartitionedTopicStats |
getPartitionedStats(String topic,
boolean perPartition)
Get the stats for the partitioned topic
|
CompletableFuture<PartitionedTopicStats> |
getPartitionedStatsAsync(String topic,
boolean perPartition)
Get the stats for the partitioned topic asynchronously
|
List<String> |
getPartitionedTopicList(String namespace)
Get the list of partitioned topics under a namespace.
|
PartitionedTopicMetadata |
getPartitionedTopicMetadata(String topic)
Get metadata of a partitioned topic.
|
CompletableFuture<PartitionedTopicMetadata> |
getPartitionedTopicMetadataAsync(String topic)
Get metadata of a partitioned topic asynchronously.
|
Map<String,Set<AuthAction>> |
getPermissions(String topic)
Get permissions on a topic.
|
TopicStats |
getStats(String topic)
Get the stats for the topic.
|
CompletableFuture<TopicStats> |
getStatsAsync(String topic)
Get the stats for the topic asynchronously.
|
List<String> |
getSubscriptions(String topic)
Get the list of subscriptions.
|
CompletableFuture<List<String>> |
getSubscriptionsAsync(String topic)
Get the list of subscriptions asynchronously.
|
void |
grantPermission(String topic,
String role,
Set<AuthAction> actions)
Grant permission on a topic.
|
List<Message<byte[]>> |
peekMessages(String topic,
String subName,
int numMessages)
Peek messages from a topic subscription
|
CompletableFuture<List<Message<byte[]>>> |
peekMessagesAsync(String topic,
String subName,
int numMessages)
Peek messages from a topic subscription asynchronously
|
void |
resetCursor(String topic,
String subName,
long timestamp)
Reset cursor position on a topic subscription
|
void |
resetCursor(String topic,
String subName,
MessageId messageId)
Reset cursor position on a topic subscription
|
CompletableFuture<Void> |
resetCursorAsync(String topic,
String subName,
long timestamp)
Reset cursor position on a topic subscription
|
CompletableFuture<Void> |
resetCursorAsync(String topic,
String subName,
MessageId messageId)
Reset cursor position on a topic subscription
|
void |
revokePermissions(String topic,
String role)
Revoke permissions on a topic.
|
void |
skipAllMessages(String topic,
String subName)
Skip all messages on a topic subscription.
|
CompletableFuture<Void> |
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.
|
CompletableFuture<Void> |
skipMessagesAsync(String topic,
String subName,
long numMessages)
Skip messages on a topic subscription asynchronously.
|
CompletableFuture<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.
|
void |
unload(String topic)
Unload a topic.
|
CompletableFuture<Void> |
unloadAsync(String topic)
Unload a topic asynchronously.
|
void |
updatePartitionedTopic(String topic,
int numPartitions)
Update number of partitions of a non-global partitioned topic.
|
CompletableFuture<Void> |
updatePartitionedTopicAsync(String topic,
int numPartitions)
Update number of partitions of a non-global partitioned topic asynchronously.
|
asyncDeleteRequest, asyncGetRequest, asyncPostRequest, asyncPutRequest, getApiException, requestpublic TopicsImpl(javax.ws.rs.client.WebTarget web,
Authentication auth)
public List<String> getList(String namespace) throws PulsarAdminException
TopicsResponse example:
["topic://my-tenant/my-namespace/topic-1",
"topic://my-tenant/my-namespace/topic-2"]
getList in interface Topicsnamespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorpublic List<String> getPartitionedTopicList(String namespace) throws PulsarAdminException
TopicsResponse example:
["persistent://my-tenant/my-namespace/topic-1",
"persistent://my-tenant/my-namespace/topic-2"]
getPartitionedTopicList in interface Topicsnamespace - Namespace namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorpublic List<String> getListInBundle(String namespace, String bundleRange) throws PulsarAdminException
TopicsgetListInBundle in interface TopicsPulsarAdminExceptionpublic CompletableFuture<List<String>> getListInBundleAsync(String namespace, String bundleRange)
TopicsgetListInBundleAsync in interface Topicspublic Map<String,Set<AuthAction>> getPermissions(String topic) throws PulsarAdminException
TopicsRetrieve 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" ]
}
getPermissions in interface Topicstopic - Topic urlPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException - Unexpected errorpublic void grantPermission(String topic, String role, Set<AuthAction> actions) throws PulsarAdminException
TopicsGrant a new permission to a client role on a single topic.
Request parameter example:
["produce", "consume"]
grantPermission in interface Topicstopic - Topic urlrole - Client role to which grant permissionactions - Auth actions (produce and consume)PulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Namespace does not existPulsarAdminException.ConflictException - Concurrent modificationPulsarAdminException - Unexpected errorpublic void revokePermissions(String topic, String role) throws PulsarAdminException
TopicsRevoke 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).
revokePermissions in interface Topicstopic - Topic urlrole - Client role to which remove permissionPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.PreconditionFailedException - Permissions are not set at the topic levelPulsarAdminException - Unexpected errorpublic void createPartitionedTopic(String topic, int numPartitions) throws PulsarAdminException
TopicsCreate a partitioned topic. It needs to be called before creating a producer for a partitioned topic.
createPartitionedTopic in interface Topicstopic - Topic namenumPartitions - Number of partitions to create of the topicPulsarAdminExceptionpublic CompletableFuture<Void> createPartitionedTopicAsync(String topic, int numPartitions)
TopicsCreate a partitioned topic asynchronously. It needs to be called before creating a producer for a partitioned topic.
createPartitionedTopicAsync in interface Topicstopic - Topic namenumPartitions - Number of partitions to create of the topicpublic void updatePartitionedTopic(String topic, int numPartitions) throws PulsarAdminException
TopicsIt 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.
updatePartitionedTopic in interface Topicstopic - Topic namenumPartitions - Number of new partitions of already exist partitioned-topicPulsarAdminExceptionpublic CompletableFuture<Void> updatePartitionedTopicAsync(String topic, int numPartitions)
TopicsIt 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.
updatePartitionedTopicAsync in interface Topicstopic - Topic namenumPartitions - Number of new partitions of already exist partitioned-topicpublic PartitionedTopicMetadata getPartitionedTopicMetadata(String topic) throws PulsarAdminException
TopicsGet metadata of a partitioned topic.
getPartitionedTopicMetadata in interface Topicstopic - Topic namePulsarAdminExceptionpublic CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMetadataAsync(String topic)
TopicsGet metadata of a partitioned topic asynchronously.
getPartitionedTopicMetadataAsync in interface Topicstopic - Topic namepublic void deletePartitionedTopic(String topic) throws PulsarAdminException
TopicsIt will also delete all the partitions of the topic if it exists.
deletePartitionedTopic in interface Topicstopic - Topic namePulsarAdminExceptionpublic void deletePartitionedTopic(String topic, boolean force) throws PulsarAdminException
TopicsIt will also delete all the partitions of the topic if it exists.
deletePartitionedTopic in interface Topicstopic - Topic nameforce - Delete topic forcefullyPulsarAdminExceptionpublic CompletableFuture<Void> deletePartitionedTopicAsync(String topic, boolean force)
TopicsIt will also delete all the partitions of the topic if it exists.
deletePartitionedTopicAsync in interface Topicstopic - Topic nameforce - Delete topic forcefullypublic void delete(String topic) throws PulsarAdminException
TopicsDelete a topic. The topic cannot be deleted if there's any active subscription or producer connected to the it.
delete in interface Topicstopic - Topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException.PreconditionFailedException - Topic has active subscriptions or producersPulsarAdminException - Unexpected errorpublic void delete(String topic, boolean force) throws PulsarAdminException
TopicsDelete 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.
delete in interface Topicstopic - Topic nameforce - Delete topic forcefullyPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException.PreconditionFailedException - Topic has active subscriptions or producersPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> deleteAsync(String topic, boolean force)
TopicsDelete 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.
deleteAsync in interface Topicstopic - topic nameforce - Delete topic forcefullypublic void unload(String topic) throws PulsarAdminException
Topicsunload in interface Topicstopic - topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - topic does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> unloadAsync(String topic)
TopicsunloadAsync in interface Topicstopic - topic namepublic List<String> getSubscriptions(String topic) throws PulsarAdminException
TopicsGet the list of persistent subscriptions for a given topic.
getSubscriptions in interface Topicstopic - topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<List<String>> getSubscriptionsAsync(String topic)
TopicsGet the list of persistent subscriptions for a given topic.
getSubscriptionsAsync in interface Topicstopic - topic namepublic TopicStats getStats(String topic) throws PulsarAdminException
TopicsResponse 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,
"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.getStats in interface Topicstopic - topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<TopicStats> getStatsAsync(String topic)
TopicsgetStatsAsync in interface Topicstopic - topic namepublic PersistentTopicInternalStats getInternalStats(String topic) throws PulsarAdminException
TopicsAccess the internal state of the topic
getInternalStats in interface Topicstopic - topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<PersistentTopicInternalStats> getInternalStatsAsync(String topic)
TopicsgetInternalStatsAsync in interface Topicstopic - topic Namepublic com.google.gson.JsonObject getInternalInfo(String topic) throws PulsarAdminException
TopicsgetInternalInfo in interface Topicstopic - topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<com.google.gson.JsonObject> getInternalInfoAsync(String topic)
TopicsgetInternalInfoAsync in interface Topicstopic - topic namepublic PartitionedTopicStats getPartitionedStats(String topic, boolean perPartition) throws PulsarAdminException
TopicsResponse 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.getPartitionedStats in interface Topicstopic - topic namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<PartitionedTopicStats> getPartitionedStatsAsync(String topic, boolean perPartition)
TopicsgetPartitionedStatsAsync in interface Topicstopic - topic NameperPartition - flag to get stats per partitionpublic void deleteSubscription(String topic, String subName) throws PulsarAdminException
TopicsDelete a persistent subscription from a topic. There should not be any active consumers on the subscription.
deleteSubscription in interface Topicstopic - topic namesubName - Subscription namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic or subscription does not existPulsarAdminException.PreconditionFailedException - Subscription has active consumersPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> deleteSubscriptionAsync(String topic, String subName)
TopicsDelete a persistent subscription from a topic. There should not be any active consumers on the subscription.
deleteSubscriptionAsync in interface Topicstopic - topic namesubName - Subscription namepublic void skipAllMessages(String topic, String subName) throws PulsarAdminException
TopicsCompletely clears the backlog on the subscription.
skipAllMessages in interface Topicstopic - topic namesubName - Subscription namePulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic or subscription does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> skipAllMessagesAsync(String topic, String subName)
TopicsCompletely clears the backlog on the subscription.
skipAllMessagesAsync in interface Topicstopic - topic namesubName - Subscription namepublic void skipMessages(String topic, String subName, long numMessages) throws PulsarAdminException
TopicsskipMessages in interface Topicstopic - topic namesubName - Subscription namenumMessages - Number of messagesPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic or subscription does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> skipMessagesAsync(String topic, String subName, long numMessages)
TopicsskipMessagesAsync in interface Topicstopic - topic namesubName - Subscription namenumMessages - Number of messagespublic void expireMessages(String topic, String subName, long expireTimeInSeconds) throws PulsarAdminException
TopicsexpireMessages in interface Topicstopic - topic nameexpireTimeInSeconds - Expire messages older than time in secondsPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> expireMessagesAsync(String topic, String subName, long expireTimeInSeconds)
TopicsexpireMessagesAsync in interface Topicstopic - topic nameexpireTimeInSeconds - Expire messages older than time in secondspublic void expireMessagesForAllSubscriptions(String topic, long expireTimeInSeconds) throws PulsarAdminException
TopicsexpireMessagesForAllSubscriptions in interface Topicstopic - topic nameexpireTimeInSeconds - Expire messages older than time in secondsPulsarAdminException - Unexpected errorpublic CompletableFuture<Void> expireMessagesForAllSubscriptionsAsync(String topic, long expireTimeInSeconds)
TopicsexpireMessagesForAllSubscriptionsAsync in interface Topicstopic - topic nameexpireTimeInSeconds - Expire messages older than time in secondspublic List<Message<byte[]>> peekMessages(String topic, String subName, int numMessages) throws PulsarAdminException
TopicspeekMessages in interface Topicstopic - topic namesubName - Subscription namenumMessages - Number of messagesPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic or subscription does not existPulsarAdminException - Unexpected errorpublic CompletableFuture<List<Message<byte[]>>> peekMessagesAsync(String topic, String subName, int numMessages)
TopicspeekMessagesAsync in interface Topicstopic - topic namesubName - Subscription namenumMessages - Number of messagespublic void createSubscription(String topic, String subscriptionName, MessageId messageId) throws PulsarAdminException
TopicscreateSubscription in interface Topicstopic - topic namesubscriptionName - Subscription namemessageId - The MessageId on where to initialize the subscription. It could be MessageId.latest,
MessageId.earliest or a specific message id.PulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.ConflictException - Subscription already existsPulsarAdminException.NotAllowedException - Command disallowed for requested resourcePulsarAdminException - Unexpected errorpublic CompletableFuture<Void> createSubscriptionAsync(String topic, String subscriptionName, MessageId messageId)
TopicscreateSubscriptionAsync in interface Topicstopic - topic namesubscriptionName - Subscription namemessageId - The MessageId on where to initialize the subscription. It could be MessageId.latest,
MessageId.earliest or a specific message id.public void resetCursor(String topic, String subName, long timestamp) throws PulsarAdminException
TopicsresetCursor in interface Topicstopic - topic namesubName - Subscription nametimestamp - reset subscription to position closest to time in ms since epochPulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic or subscription does not existPulsarAdminException.NotAllowedException - Command disallowed for requested resourcePulsarAdminException - Unexpected errorpublic CompletableFuture<Void> resetCursorAsync(String topic, String subName, long timestamp)
TopicsresetCursorAsync in interface Topicstopic - topic namesubName - Subscription nametimestamp - reset subscription to position closest to time in ms since epochpublic void resetCursor(String topic, String subName, MessageId messageId) throws PulsarAdminException
TopicsresetCursor in interface Topicstopic - topic namesubName - Subscription namemessageId - reset subscription to messageId (or previous nearest messageId if given messageId is not valid)PulsarAdminException.NotAuthorizedException - Don't have admin permissionPulsarAdminException.NotFoundException - Topic or subscription does not existPulsarAdminException.NotAllowedException - Command disallowed for requested resourcePulsarAdminException - Unexpected errorpublic CompletableFuture<Void> resetCursorAsync(String topic, String subName, MessageId messageId)
TopicsresetCursorAsync in interface Topicstopic - topic namesubName - Subscription namepublic CompletableFuture<MessageId> terminateTopicAsync(String topic)
TopicsThis
terminateTopicAsync in interface Topicstopic - topic namepublic void triggerCompaction(String topic) throws PulsarAdminException
TopicstriggerCompaction in interface Topicstopic - The topic on which to trigger compactionPulsarAdminExceptionpublic CompactionStatus compactionStatus(String topic) throws PulsarAdminException
TopicscompactionStatus in interface Topicstopic - The topic whose compaction status we wish to checkPulsarAdminExceptionCopyright © 2017–2018 Apache Software Foundation. All rights reserved.