You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "KamenRiderKuuga (via GitHub)" <gi...@apache.org> on 2023/03/09 16:23:43 UTC

[GitHub] [pulsar] KamenRiderKuuga opened a new issue, #19770: [Bug]

KamenRiderKuuga opened a new issue, #19770:
URL: https://github.com/apache/pulsar/issues/19770

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Version
   
   standalone Pulsar cluster in Kubernetes with image tag apachepulsar/pulsar:2.10.2
   
   ### Minimal reproduce step
   
   This is all the code I use:
   ```java
   public static void main(String[] args) throws PulsarClientException, PulsarAdminException, InterruptedException {
       AuthenticationBasic auth = new AuthenticationBasic();
       auth.configure("{\"userId\":\"superuser\",\"password\":\"admin\"}");
       String serviceHttpUrl = "http://127.0.0.1:8080";
       String serviceUrl = "pulsar://127.0.0.1:6650";
       String tenant = "demo-tenant";
       String namespace = "demo-tenant/demo-namespace";
       PulsarAdmin admin = PulsarAdmin.builder().serviceHttpUrl(serviceHttpUrl).authentication(auth).build();
       if (!admin.tenants().getTenants().contains(tenant)) {
           admin.tenants().createTenant(tenant, TenantInfo.builder().adminRoles(Set.of("superuser")).allowedClusters
       }
       if (!admin.namespaces().getNamespaces(tenant).contains(namespace)) {
           admin.namespaces().createNamespace(namespace);
       }
       PulsarClient pulsarClient = PulsarClient.builder().serviceUrl(serviceUrl).authentication(auth).build();
       Producer<String> producer = pulsarClient.newProducer(Schema.STRING).topic("persistent://" + namespace + "/lev
       producer.newMessage().value("demo-data").send();
       // wait for few seconds
       Thread.sleep(3000);
       // print the topics
       List<String> topics = admin.topics().getList(namespace);
       // the list of topics will be empty
       topics.forEach(System.out::println);
       producer = pulsarClient.newProducer(Schema.STRING).topic("persistent://" + namespace + "/level1").create();
       producer.newMessage().value("demo-data").send();
       // wait for few seconds
       Thread.sleep(3000);
       topics = admin.topics().getList(namespace);
       // the list of topics is : ["persistent://demo-tenant/demo-namespace/level1"]
       topics.forEach(System.out::println);
   }
   ```
   
   ### What did you expect to see?
   
   When I use the topic `persistent://demo-tenant/demo-namespace/level1/level2/level3`, I think I should also see it in the query results of topic list
   
   ### What did you see instead?
   
   I can only get the `persistent://demo-tenant/demo-namespace/level1` in the query results
   
   ### Anything else?
   
   #19752 
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] KamenRiderKuuga commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "KamenRiderKuuga (via GitHub)" <gi...@apache.org>.
KamenRiderKuuga commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1557390343

   > @KamenRiderKuuga may I ask how this issue gets resolved for you?
   
   Just avoid using these characters as Topic in the code, we use the hyphens to replace the slashes.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] KamenRiderKuuga commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "KamenRiderKuuga (via GitHub)" <gi...@apache.org>.
KamenRiderKuuga commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1467182211

   Should I avoid topic names with slashes?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] KamenRiderKuuga commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "KamenRiderKuuga (via GitHub)" <gi...@apache.org>.
KamenRiderKuuga commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1485231337

   OK, I think I will use the `-` for splitting, thank you very much!
   Also, the description of these restrictions will be placed in the official documentation, right?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1524435264

   The issue had no activity for 30 days, mark with Stale label.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] tisonkun commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1485218015

   @mattisonchao so do you think that prohibit slashes in topic name is by design or we should support it later?
   
   If it should be limited, this issue can be a subtask for #19239 and we add such a restriction.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] mattisonchao commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "mattisonchao (via GitHub)" <gi...@apache.org>.
mattisonchao commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1485222598

   It should be limited.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] KamenRiderKuuga commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "KamenRiderKuuga (via GitHub)" <gi...@apache.org>.
KamenRiderKuuga commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1463283771

   #6885


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] mattisonchao commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "mattisonchao (via GitHub)" <gi...@apache.org>.
mattisonchao commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1485214785

   Yes, the topic name should follow the rule as follow:
   ```java
       // allowed characters for property, namespace, cluster and topic names are
       // alphanumeric (a-zA-Z_0-9) and these special chars -=:.
       // % is allowed as part of valid URL encoding
       public static final Pattern NAMED_ENTITY_PATTERN = Pattern.compile("^[-=:.\\w]*$");
   ```
   
   Pulsar hasn't a good topic name limit yet, but it is being added.
   
   /cc @tisonkun @KamenRiderKuuga 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] tisonkun commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1485196222

   > Should I avoid topic names with slashes?
   
   Yes for now.
   
   IIRC https://github.com/apache/pulsar/issues/19239 makes some topic name restrictions. @mattisonchao maybe you can take a look at this issue?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] tisonkun commented on issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #19770:
URL: https://github.com/apache/pulsar/issues/19770#issuecomment-1548877877

   @KamenRiderKuuga may I ask how this issue gets resolved for you?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] KamenRiderKuuga closed issue #19770: [Bug] Topics with slashes cannot be queried

Posted by "KamenRiderKuuga (via GitHub)" <gi...@apache.org>.
KamenRiderKuuga closed issue #19770: [Bug] Topics with slashes cannot be queried
URL: https://github.com/apache/pulsar/issues/19770


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org