You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/14 15:33:19 UTC
[GitHub] [pulsar-client-go] freeznet opened a new pull request #541: #540 fix lookup service not implemented GetTopicsOfNamespace
freeznet opened a new pull request #541:
URL: https://github.com/apache/pulsar-client-go/pull/541
Fixes #540
### Motivation
When using regex topics consumer with HTTP client URL, the client will fail to query namespace topics and throw failed handshake error. This is because the client sends protobuf requests to HTTP service.
### Modifications
add GetTopicsOfNamespace to LookupService interface
add related tests
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
--
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:
users@infra.apache.org
[GitHub] [pulsar-client-go] wolfstudy commented on pull request #541: #540 fix lookup service not implemented GetTopicsOfNamespace
Posted by GitBox <gi...@apache.org>.
wolfstudy commented on pull request #541:
URL: https://github.com/apache/pulsar-client-go/pull/541#issuecomment-861999816
@freeznet Please fix the CI error, thanks.
--
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:
users@infra.apache.org
[GitHub] [pulsar-client-go] freeznet commented on a change in pull request #541: #540 fix lookup service not implemented GetTopicsOfNamespace
Posted by GitBox <gi...@apache.org>.
freeznet commented on a change in pull request #541:
URL: https://github.com/apache/pulsar-client-go/pull/541#discussion_r652270539
##########
File path: pulsar/consumer_regex.go
##########
@@ -343,7 +343,7 @@ func (c *regexConsumer) unsubscribe(topics []string) {
}
func (c *regexConsumer) topics() ([]string, error) {
- topics, err := c.client.namespaceTopics(c.namespace)
+ topics, err := c.client.lookupService.GetTopicsOfNamespace(c.namespace, internal.Persistent)
Review comment:
not actually for other client like Java, but this PR does not tend to add `non-persistence` and `all` supporting, will do it in another 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-go] freeznet commented on pull request #541: #540 fix lookup service not implemented GetTopicsOfNamespace
Posted by GitBox <gi...@apache.org>.
freeznet commented on pull request #541:
URL: https://github.com/apache/pulsar-client-go/pull/541#issuecomment-861958106
/pulsarbot run-failure-checks
--
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:
users@infra.apache.org
[GitHub] [pulsar-client-go] cckellogg commented on a change in pull request #541: #540 fix lookup service not implemented GetTopicsOfNamespace
Posted by GitBox <gi...@apache.org>.
cckellogg commented on a change in pull request #541:
URL: https://github.com/apache/pulsar-client-go/pull/541#discussion_r651442862
##########
File path: pulsar/internal/namespace_name.go
##########
@@ -0,0 +1,26 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package internal
+
+import "strings"
+
+func IsV2NameSpaceName(namespace string) bool {
+ parts := strings.Split(namespace, "/")
+ // Legacy namespace name that includes cluster name
+ return len(parts) != 3
Review comment:
should this be `len(parts) == 2` ? What if `ns` or `ns/1/2/3` are passed in?
Let's be consistent and use `Namespace`
##########
File path: pulsar/consumer_regex.go
##########
@@ -343,7 +343,7 @@ func (c *regexConsumer) unsubscribe(topics []string) {
}
func (c *regexConsumer) topics() ([]string, error) {
- topics, err := c.client.namespaceTopics(c.namespace)
+ topics, err := c.client.lookupService.GetTopicsOfNamespace(c.namespace, internal.Persistent)
Review comment:
For regex are only persistent topics supported?
--
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:
users@infra.apache.org