apache/pulsar · error · RestException
getPartitionedTopicNotFoundErrorMessage(topicName.toString()
Error message
getPartitionedTopicNotFoundErrorMessage(topicName.toString())
What it means
Helper that formats the NOT_FOUND message for a missing partitioned topic in topicNotFoundReasonAsync; it delegates to getPartitionedTopicNotFoundErrorMessage and is not itself an independent error cause.
Source
Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4720
getTopicNotFoundErrorMessage(topicName.toString())));
}
return getPartitionedTopicMetadataAsync(
TopicName.get(topicName.getPartitionedTopicName()), false, false)
.thenAccept(partitionedTopicMetadata -> {
if (partitionedTopicMetadata == null || partitionedTopicMetadata.partitions == 0) {
final String topicErrorType = partitionedTopicMetadata
== null ? "has no metadata" : "has zero partitions";
throw new RestException(Status.NOT_FOUND, String.format(
"Partitioned Topic not found: %s %s", topicName.toString(), topicErrorType));
}
})
.thenCompose(__ -> internalGetListAsync(Optional.empty(), null))
.thenApply(topics -> {
if (!topics.contains(topicName.toString())) {
throw new RestException(Status.NOT_FOUND, "Topic partitions were not yet created");
}
throw new RestException(Status.NOT_FOUND,
getPartitionedTopicNotFoundErrorMessage(topicName.toString()));
});
}
/**
* Find the subscription or create it when automatic subscription creation is allowed.
*/
private CompletableFuture<Subscription> findOrCreateSubscriptionAsync(String subName, PersistentTopic topic) {
Subscription subscription = topic.getSubscription(subName);
if (subscription != null) {
return CompletableFuture.completedFuture(subscription);
}
return pulsar().getBrokerService().isAllowAutoSubscriptionCreationAsync(topicName)
.thenCompose(isAllowed -> {
Subscription existingSubscription = topic.getSubscription(subName);
if (existingSubscription != null) {
return CompletableFuture.completedFuture(existingSubscription);View on GitHub (pinned to 820761864e)
Solutions
- Treat as 'partitioned topic not found': create the topic or fix its name
- Verify partitioned topic metadata exists in the metadata store
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4720 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/46e2872166b36d0b.
Report an issue: GitHub.