BewareMyPower opened a new issue #8813:
URL: https://github.com/apache/pulsar/issues/8813
**Describe the bug**
When getting the partition metadata for a non-existed topic, it returns 0
instead of throwing an exception.
**To Reproduce**
Steps to reproduce the behavior:
1. Run a pulsar standalone
2. Get a topic's partition number
```java
try (PulsarAdmin admin =
PulsarAdmin.builder().serviceHttpUrl("http://localhost:8080").build()) {
System.out.println(admin.topics().getPartitionedTopicMetadata("xxxxx").partitions);
} catch (/* ... */) {
```
3. The output is 0 and no exception was thrown.
**Expected behavior**
It should throw an exception because for a non-partitioned topic, its
partitions should be 0, so we cannot distinguish a non-existed topic from a
non-partitioned topic.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]