hangc0276 commented on a change in pull request #9042:
URL: https://github.com/apache/pulsar/pull/9042#discussion_r548338780



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -811,9 +811,14 @@ protected boolean isNamespaceReplicated(NamespaceName 
namespaceName) {
     }
 
     protected void internalCreatePartitionedTopic(AsyncResponse asyncResponse, 
int numPartitions) {
-        final int maxTopicsPerNamespace = 
pulsar().getConfig().getMaxTopicsPerNamespace();
-        if (maxTopicsPerNamespace > 0) {
-            try {
+        Integer maxTopicsPerNamespace;
+        try {
+            maxTopicsPerNamespace = 
getNamespacePolicies(namespaceName).max_topics_per_namespace;
+            if (maxTopicsPerNamespace == null || maxTopicsPerNamespace < 0) {

Review comment:
       OK, `maxTopicsPerNamespace` is get from namespace policy, it must be 
greater than 0, i update the code.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to