You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/22 06:50:07 UTC

[GitHub] [dubbo-go] chuntaojun opened a new pull request, #2132: [ISSUE #2124] feat:support polaris router ability

chuntaojun opened a new pull request, #2132:
URL: https://github.com/apache/dubbo-go/pull/2132

   <!--  Thanks for sending a pull request!
   Read https://github.com/apache/dubbo-go/blob/master/CONTRIBUTING.md before commit pull request.
   -->
   
   **What this PR does**: 
   
   **Which issue(s) this PR fixes**: 
   Fixes #2124 
   
   **You should pay attention to items below to ensure your pr passes our ci test**
   We do not merge pr with ci tests failed
   
   - [ ] All ut passed (run 'go test ./...' in project root)
   - [ ] After go-fmt ed , run 'go fmt project' using goland.
   - [ ] Golangci-lint passed, run 'sudo golangci-lint run' in project root.
   - [ ] Your new-created file needs to have [apache license](https://raw.githubusercontent.com/dubbogo/resources/master/tools/license/license.txt) at the top, like other existed file does.
   - [ ] All integration test passed. You can run integration test locally (with docker env). Clone our [dubbo-go-samples](https://github.com/apache/dubbo-go-samples) project and replace the go.mod to your dubbo-go, and run 'sudo sh start_integration_test.sh' at root of samples project root. (M1 Slice is not Support)


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] sonarcloud[bot] commented on pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#issuecomment-1328032722

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=2132)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132) No Coverage information  
   [![0.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.5%')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list) [0.5% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] AlexStocks merged pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
AlexStocks merged PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] sonarcloud[bot] commented on pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#issuecomment-1323196915

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=2132)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132) No Coverage information  
   [![0.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.4%')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list) [0.4% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] chuntaojun commented on a diff in pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
chuntaojun commented on code in PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#discussion_r1031976623


##########
cluster/router/polaris/involer.go:
##########
@@ -0,0 +1,175 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+)
+
+import (
+	"github.com/polarismesh/polaris-go/pkg/model"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+)
+
+var (
+	_ model.Instance   = (*polarisInvoker)(nil)
+	_ protocol.Invoker = (*polarisInvoker)(nil)
+)
+
+func newPolarisInvoker(invoker protocol.Invoker) *polarisInvoker {
+	p := &polarisInvoker{invoker: invoker}
+	return p
+}
+
+type polarisInvoker struct {
+	invoker protocol.Invoker
+	ins     model.Instance
+}
+
+// GetInstanceKey 获取实例四元组标识
+func (p *polarisInvoker) GetInstanceKey() model.InstanceKey {
+	return p.ins.GetInstanceKey()
+}
+
+// GetNamespace 实例所在命名空间
+func (p *polarisInvoker) GetNamespace() string {
+	return p.ins.GetNamespace()
+}
+
+// GetService 实例所在服务名
+func (p *polarisInvoker) GetService() string {
+	return p.ins.GetService()
+}
+
+// GetId 服务实例唯一标识
+func (p *polarisInvoker) GetId() string {
+	return p.ins.GetId()
+}
+
+// GetHost 实例的域名/IP信息
+func (p *polarisInvoker) GetHost() string {
+	return p.ins.GetHost()
+}
+
+// GetPort 实例的监听端口
+func (p *polarisInvoker) GetPort() uint32 {
+	return p.ins.GetPort()
+}
+
+// GetVpcId 实例的vpcId
+func (p *polarisInvoker) GetVpcId() string {
+	return p.ins.GetVpcId()
+}
+
+// GetProtocol 服务实例的协议
+func (p *polarisInvoker) GetProtocol() string {
+	return p.ins.GetProtocol()
+}
+
+// GetVersion 实例版本号
+func (p *polarisInvoker) GetVersion() string {
+	return p.ins.GetVersion()
+}
+
+// GetWeight 实例静态权重值
+func (p *polarisInvoker) GetWeight() int {
+	return p.ins.GetWeight()
+}
+
+// GetPriority 实例优先级信息
+func (p *polarisInvoker) GetPriority() uint32 {
+	return p.ins.GetPriority()
+}
+
+// GetMetadata 实例元数据信息
+func (p *polarisInvoker) GetMetadata() map[string]string {
+	return p.ins.GetMetadata()
+}
+
+// GetLogicSet 实例逻辑分区
+func (p *polarisInvoker) GetLogicSet() string {
+	return p.ins.GetLogicSet()
+}
+
+// GetCircuitBreakerStatus 实例的断路器状态,包括:
+// 打开(被熔断)、半开(探测恢复)、关闭(正常运行)
+func (p *polarisInvoker) GetCircuitBreakerStatus() model.CircuitBreakerStatus {
+	return p.ins.GetCircuitBreakerStatus()
+}
+
+// IsHealthy 实例是否健康,基于服务端返回的健康数据

Review Comment:
   ok



-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] AlexStocks commented on a diff in pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on code in PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#discussion_r1032726009


##########
cluster/router/polaris/involer.go:
##########
@@ -0,0 +1,175 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+)
+
+import (
+	"github.com/polarismesh/polaris-go/pkg/model"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+)
+
+var (
+	_ model.Instance   = (*polarisInvoker)(nil)
+	_ protocol.Invoker = (*polarisInvoker)(nil)
+)
+
+func newPolarisInvoker(invoker protocol.Invoker) *polarisInvoker {
+	p := &polarisInvoker{invoker: invoker}
+	return p
+}
+
+type polarisInvoker struct {
+	invoker protocol.Invoker
+	ins     model.Instance
+}
+
+// GetInstanceKey 获取实例四元组标识

Review Comment:
   add the comment in english, pls.



-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] chuntaojun commented on a diff in pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
chuntaojun commented on code in PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#discussion_r1032777750


##########
cluster/router/polaris/router.go:
##########
@@ -0,0 +1,314 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"strings"
+	"sync"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log/logger"
+
+	"github.com/polarismesh/polaris-go"
+	"github.com/polarismesh/polaris-go/pkg/model"
+	v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/cluster/router"
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/common/constant"
+	"dubbo.apache.org/dubbo-go/v3/config"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+	remotingpolaris "dubbo.apache.org/dubbo-go/v3/remoting/polaris"
+	"dubbo.apache.org/dubbo-go/v3/remoting/polaris/parser"
+)
+
+var (
+	_ router.PriorityRouter = (*polarisRouter)(nil)
+)
+
+var (
+	ErrorPolarisServiceRouteRuleEmpty = errors.New("service route rule is empty")
+)
+
+func newPolarisRouter() (*polarisRouter, error) {
+	routerApi, err := remotingpolaris.GetRouterAPI()
+	if err != nil {
+		return nil, err
+	}
+	consumerApi, err := remotingpolaris.GetConsumerAPI()
+	if err != nil {
+		return nil, err
+	}
+
+	return &polarisRouter{
+		routerApi:   routerApi,
+		consumerApi: consumerApi,
+	}, nil
+}
+
+type polarisRouter struct {
+	routerApi   polaris.RouterAPI
+	consumerApi polaris.ConsumerAPI
+
+	cancel context.CancelFunc
+
+	lock      sync.RWMutex
+	instances map[string]model.Instance
+}
+
+// Route Determine the target invokers list.
+func (p *polarisRouter) Route(invokers []protocol.Invoker, url *common.URL,
+	invoaction protocol.Invocation) []protocol.Invoker {
+
+	if len(invokers) == 0 {
+		logger.Warnf("[tag router] invokers from previous router is empty")
+		return invokers
+	}
+
+	service := getService(url)
+	instanceMap := p.buildInstanceMap(service)
+	if len(instanceMap) == 0 {
+		return invokers
+	}
+
+	invokersMap := make(map[string]protocol.Invoker, len(invokers))
+	targetIns := make([]model.Instance, 0, len(invokers))
+	for i := range invokers {
+		invoker := invokers[i]
+		instanceId := invoker.GetURL().GetParam(constant.PolarisInstanceID, "")
+		if len(instanceId) == 0 {
+			continue
+		}
+		invokersMap[instanceId] = invoker
+		if val, ok := instanceMap[instanceId]; ok {
+			targetIns = append(targetIns, val)
+		}
+	}
+
+	req, err := p.buildRouteRequest(service, url, invoaction)
+	if err != nil {
+		return invokers
+	}
+	req.DstInstances = model.NewDefaultServiceInstances(model.ServiceInfo{
+		Service:   service,
+		Namespace: remotingpolaris.GetNamespace(),
+	}, targetIns)
+
+	resp, err := p.routerApi.ProcessRouters(&req)
+	if err != nil {
+		return invokers
+	}
+
+	ret := make([]protocol.Invoker, 0, len(resp.GetInstances()))
+	for i := range resp.GetInstances() {
+		if val, ok := invokersMap[resp.GetInstances()[i].GetId()]; ok {
+			ret = append(ret, val)
+		}
+	}
+
+	return ret
+}
+
+func getService(url *common.URL) string {
+	applicationMode := false
+	for _, item := range config.GetRootConfig().Registries {
+		if item.Protocol == constant.PolarisKey {
+			applicationMode = item.RegistryType == constant.ServiceKey
+		}
+	}
+
+	service := "providers:" + url.Service()
+	if applicationMode {
+		service = config.GetApplicationConfig().Name
+	}
+
+	return service
+}
+
+func (p *polarisRouter) buildRouteRequest(svc string, url *common.URL,
+	invoaction protocol.Invocation) (polaris.ProcessRoutersRequest, error) {
+
+	routeReq := polaris.ProcessRoutersRequest{
+		ProcessRoutersRequest: model.ProcessRoutersRequest{
+			SourceService: model.ServiceInfo{
+				Metadata: map[string]string{},
+			},
+		},
+	}
+
+	attachement := invoaction.Attachments()
+	arguments := invoaction.Arguments()
+
+	labels, err := p.buildTrafficLabels(svc)
+	if err != nil {
+		return polaris.ProcessRoutersRequest{}, err
+	}
+
+	for i := range labels {
+		label := labels[i]
+		if strings.Compare(label, model.LabelKeyPath) == 0 {
+			routeReq.AddArguments(model.BuildPathArgument(getInvokeMethod(url, invoaction)))
+			continue
+		}
+		if strings.HasPrefix(label, model.LabelKeyHeader) {
+			if val, ok := attachement[strings.TrimPrefix(label, model.LabelKeyHeader)]; ok {
+				routeReq.SourceService.Metadata[label] = fmt.Sprintf("%+v", val)
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+		if strings.HasPrefix(label, model.LabelKeyQuery) {
+			if val := parser.ParseArgumentsByExpression(label, arguments); val != nil {
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+	}
+
+	return routeReq, nil
+}
+
+func (p *polarisRouter) buildTrafficLabels(svc string) ([]string, error) {
+	req := &model.GetServiceRuleRequest{}
+	req.Namespace = remotingpolaris.GetNamespace()
+	req.Service = svc
+	req.SetTimeout(time.Second)
+	engine := p.routerApi.SDKContext().GetEngine()
+	resp, err := engine.SyncGetServiceRule(model.EventRouting, req)
+	if err != nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule fail : %+v", req.GetNamespace(), req.GetService(), err)
+		return nil, err
+	}
+
+	if resp == nil || resp.GetValue() == nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule empty", req.GetNamespace(), req.GetService())
+		return nil, ErrorPolarisServiceRouteRuleEmpty
+	}
+
+	routeRule := resp.GetValue().(*v1.Routing)
+	labels := make([]string, 0, 4)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+
+	return labels, nil
+}
+
+func getInvokeMethod(url *common.URL, invoaction protocol.Invocation) string {
+	applicationMode := false
+	for _, item := range config.GetRootConfig().Registries {
+		if item.Protocol == constant.PolarisKey {
+			applicationMode = item.RegistryType == constant.ServiceKey
+		}
+	}
+
+	method := invoaction.MethodName()
+	if applicationMode {
+		method = url.Interface() + "/" + invoaction.MethodName()
+	}
+
+	return method
+}
+
+func collectRouteLabels(routings []*v1.Route) []string {
+	ret := make([]string, 0, 4)
+
+	for i := range routings {
+		route := routings[i]
+		sources := route.GetSources()
+		for p := range sources {
+			source := sources[p]
+			for k := range source.GetMetadata() {
+				ret = append(ret, k)
+			}
+		}
+	}
+
+	return ret
+}
+
+func (p *polarisRouter) buildInstanceMap(svc string) map[string]model.Instance {
+	resp, err := p.consumerApi.GetAllInstances(&polaris.GetAllInstancesRequest{
+		GetAllInstancesRequest: model.GetAllInstancesRequest{
+			Service:   svc,
+			Namespace: remotingpolaris.GetNamespace(),
+		},
+	})
+	if err != nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get all instances fail : %+v", remotingpolaris.GetNamespace(), svc, err)
+		return nil
+	}
+
+	ret := make(map[string]model.Instance, len(resp.GetInstances()))
+
+	for i := range resp.GetInstances() {
+		ret[resp.GetInstances()[i].GetId()] = resp.GetInstances()[i]
+	}
+
+	return ret
+}
+
+// URL Return URL in router
+func (p *polarisRouter) URL() *common.URL {
+	return nil
+}
+
+// Priority Return Priority in router
+// 0 to ^int(0) is better
+func (p *polarisRouter) Priority() int64 {
+	return 0

Review Comment:
   仅用于 RouterChain 中对 PriorityRouter 进行排序,返回 0 表示最高优先级



-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] chuntaojun commented on a diff in pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
chuntaojun commented on code in PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#discussion_r1032777798


##########
cluster/router/polaris/router.go:
##########
@@ -0,0 +1,314 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"strings"
+	"sync"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log/logger"
+
+	"github.com/polarismesh/polaris-go"
+	"github.com/polarismesh/polaris-go/pkg/model"
+	v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/cluster/router"
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/common/constant"
+	"dubbo.apache.org/dubbo-go/v3/config"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+	remotingpolaris "dubbo.apache.org/dubbo-go/v3/remoting/polaris"
+	"dubbo.apache.org/dubbo-go/v3/remoting/polaris/parser"
+)
+
+var (
+	_ router.PriorityRouter = (*polarisRouter)(nil)
+)
+
+var (
+	ErrorPolarisServiceRouteRuleEmpty = errors.New("service route rule is empty")
+)
+
+func newPolarisRouter() (*polarisRouter, error) {
+	routerApi, err := remotingpolaris.GetRouterAPI()
+	if err != nil {
+		return nil, err
+	}
+	consumerApi, err := remotingpolaris.GetConsumerAPI()
+	if err != nil {
+		return nil, err
+	}
+
+	return &polarisRouter{
+		routerApi:   routerApi,
+		consumerApi: consumerApi,
+	}, nil
+}
+
+type polarisRouter struct {
+	routerApi   polaris.RouterAPI
+	consumerApi polaris.ConsumerAPI
+
+	cancel context.CancelFunc
+
+	lock      sync.RWMutex
+	instances map[string]model.Instance
+}
+
+// Route Determine the target invokers list.
+func (p *polarisRouter) Route(invokers []protocol.Invoker, url *common.URL,
+	invoaction protocol.Invocation) []protocol.Invoker {
+
+	if len(invokers) == 0 {
+		logger.Warnf("[tag router] invokers from previous router is empty")
+		return invokers
+	}
+
+	service := getService(url)
+	instanceMap := p.buildInstanceMap(service)
+	if len(instanceMap) == 0 {
+		return invokers
+	}
+
+	invokersMap := make(map[string]protocol.Invoker, len(invokers))
+	targetIns := make([]model.Instance, 0, len(invokers))
+	for i := range invokers {
+		invoker := invokers[i]
+		instanceId := invoker.GetURL().GetParam(constant.PolarisInstanceID, "")
+		if len(instanceId) == 0 {
+			continue
+		}
+		invokersMap[instanceId] = invoker
+		if val, ok := instanceMap[instanceId]; ok {
+			targetIns = append(targetIns, val)
+		}
+	}
+
+	req, err := p.buildRouteRequest(service, url, invoaction)
+	if err != nil {
+		return invokers
+	}
+	req.DstInstances = model.NewDefaultServiceInstances(model.ServiceInfo{
+		Service:   service,
+		Namespace: remotingpolaris.GetNamespace(),
+	}, targetIns)
+
+	resp, err := p.routerApi.ProcessRouters(&req)
+	if err != nil {
+		return invokers
+	}
+
+	ret := make([]protocol.Invoker, 0, len(resp.GetInstances()))
+	for i := range resp.GetInstances() {
+		if val, ok := invokersMap[resp.GetInstances()[i].GetId()]; ok {
+			ret = append(ret, val)
+		}
+	}
+
+	return ret
+}
+
+func getService(url *common.URL) string {
+	applicationMode := false
+	for _, item := range config.GetRootConfig().Registries {
+		if item.Protocol == constant.PolarisKey {
+			applicationMode = item.RegistryType == constant.ServiceKey
+		}
+	}
+
+	service := "providers:" + url.Service()
+	if applicationMode {
+		service = config.GetApplicationConfig().Name
+	}
+
+	return service
+}
+
+func (p *polarisRouter) buildRouteRequest(svc string, url *common.URL,
+	invoaction protocol.Invocation) (polaris.ProcessRoutersRequest, error) {
+
+	routeReq := polaris.ProcessRoutersRequest{
+		ProcessRoutersRequest: model.ProcessRoutersRequest{
+			SourceService: model.ServiceInfo{
+				Metadata: map[string]string{},
+			},
+		},
+	}
+
+	attachement := invoaction.Attachments()
+	arguments := invoaction.Arguments()
+
+	labels, err := p.buildTrafficLabels(svc)
+	if err != nil {
+		return polaris.ProcessRoutersRequest{}, err
+	}
+
+	for i := range labels {
+		label := labels[i]
+		if strings.Compare(label, model.LabelKeyPath) == 0 {
+			routeReq.AddArguments(model.BuildPathArgument(getInvokeMethod(url, invoaction)))
+			continue
+		}
+		if strings.HasPrefix(label, model.LabelKeyHeader) {
+			if val, ok := attachement[strings.TrimPrefix(label, model.LabelKeyHeader)]; ok {
+				routeReq.SourceService.Metadata[label] = fmt.Sprintf("%+v", val)
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+		if strings.HasPrefix(label, model.LabelKeyQuery) {
+			if val := parser.ParseArgumentsByExpression(label, arguments); val != nil {
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+	}
+
+	return routeReq, nil
+}
+
+func (p *polarisRouter) buildTrafficLabels(svc string) ([]string, error) {
+	req := &model.GetServiceRuleRequest{}
+	req.Namespace = remotingpolaris.GetNamespace()
+	req.Service = svc
+	req.SetTimeout(time.Second)
+	engine := p.routerApi.SDKContext().GetEngine()
+	resp, err := engine.SyncGetServiceRule(model.EventRouting, req)
+	if err != nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule fail : %+v", req.GetNamespace(), req.GetService(), err)
+		return nil, err
+	}
+
+	if resp == nil || resp.GetValue() == nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule empty", req.GetNamespace(), req.GetService())
+		return nil, ErrorPolarisServiceRouteRuleEmpty
+	}
+
+	routeRule := resp.GetValue().(*v1.Routing)
+	labels := make([]string, 0, 4)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+
+	return labels, nil
+}
+
+func getInvokeMethod(url *common.URL, invoaction protocol.Invocation) string {
+	applicationMode := false
+	for _, item := range config.GetRootConfig().Registries {
+		if item.Protocol == constant.PolarisKey {
+			applicationMode = item.RegistryType == constant.ServiceKey
+		}
+	}
+
+	method := invoaction.MethodName()
+	if applicationMode {
+		method = url.Interface() + "/" + invoaction.MethodName()
+	}
+
+	return method
+}
+
+func collectRouteLabels(routings []*v1.Route) []string {
+	ret := make([]string, 0, 4)
+
+	for i := range routings {
+		route := routings[i]
+		sources := route.GetSources()
+		for p := range sources {
+			source := sources[p]
+			for k := range source.GetMetadata() {
+				ret = append(ret, k)
+			}
+		}
+	}
+
+	return ret
+}
+
+func (p *polarisRouter) buildInstanceMap(svc string) map[string]model.Instance {
+	resp, err := p.consumerApi.GetAllInstances(&polaris.GetAllInstancesRequest{
+		GetAllInstancesRequest: model.GetAllInstancesRequest{
+			Service:   svc,
+			Namespace: remotingpolaris.GetNamespace(),
+		},
+	})
+	if err != nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get all instances fail : %+v", remotingpolaris.GetNamespace(), svc, err)
+		return nil
+	}
+
+	ret := make(map[string]model.Instance, len(resp.GetInstances()))
+
+	for i := range resp.GetInstances() {
+		ret[resp.GetInstances()[i].GetId()] = resp.GetInstances()[i]
+	}
+
+	return ret
+}
+
+// URL Return URL in router
+func (p *polarisRouter) URL() *common.URL {
+	return nil

Review Comment:
   i see all impl is return nil



-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] justxuewei commented on a diff in pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
justxuewei commented on code in PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#discussion_r1032763172


##########
cluster/router/polaris/router.go:
##########
@@ -0,0 +1,314 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"strings"
+	"sync"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log/logger"
+
+	"github.com/polarismesh/polaris-go"
+	"github.com/polarismesh/polaris-go/pkg/model"
+	v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/cluster/router"
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/common/constant"
+	"dubbo.apache.org/dubbo-go/v3/config"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+	remotingpolaris "dubbo.apache.org/dubbo-go/v3/remoting/polaris"
+	"dubbo.apache.org/dubbo-go/v3/remoting/polaris/parser"
+)
+
+var (
+	_ router.PriorityRouter = (*polarisRouter)(nil)
+)
+
+var (
+	ErrorPolarisServiceRouteRuleEmpty = errors.New("service route rule is empty")
+)
+
+func newPolarisRouter() (*polarisRouter, error) {
+	routerApi, err := remotingpolaris.GetRouterAPI()
+	if err != nil {
+		return nil, err
+	}
+	consumerApi, err := remotingpolaris.GetConsumerAPI()
+	if err != nil {
+		return nil, err
+	}
+
+	return &polarisRouter{
+		routerApi:   routerApi,
+		consumerApi: consumerApi,
+	}, nil
+}
+
+type polarisRouter struct {
+	routerApi   polaris.RouterAPI
+	consumerApi polaris.ConsumerAPI
+
+	cancel context.CancelFunc
+
+	lock      sync.RWMutex
+	instances map[string]model.Instance
+}
+
+// Route Determine the target invokers list.
+func (p *polarisRouter) Route(invokers []protocol.Invoker, url *common.URL,
+	invoaction protocol.Invocation) []protocol.Invoker {
+
+	if len(invokers) == 0 {
+		logger.Warnf("[tag router] invokers from previous router is empty")
+		return invokers
+	}
+
+	service := getService(url)
+	instanceMap := p.buildInstanceMap(service)
+	if len(instanceMap) == 0 {
+		return invokers
+	}
+
+	invokersMap := make(map[string]protocol.Invoker, len(invokers))
+	targetIns := make([]model.Instance, 0, len(invokers))
+	for i := range invokers {
+		invoker := invokers[i]
+		instanceId := invoker.GetURL().GetParam(constant.PolarisInstanceID, "")
+		if len(instanceId) == 0 {
+			continue
+		}
+		invokersMap[instanceId] = invoker
+		if val, ok := instanceMap[instanceId]; ok {
+			targetIns = append(targetIns, val)
+		}
+	}
+
+	req, err := p.buildRouteRequest(service, url, invoaction)
+	if err != nil {
+		return invokers
+	}
+	req.DstInstances = model.NewDefaultServiceInstances(model.ServiceInfo{
+		Service:   service,
+		Namespace: remotingpolaris.GetNamespace(),
+	}, targetIns)
+
+	resp, err := p.routerApi.ProcessRouters(&req)
+	if err != nil {
+		return invokers
+	}
+
+	ret := make([]protocol.Invoker, 0, len(resp.GetInstances()))
+	for i := range resp.GetInstances() {
+		if val, ok := invokersMap[resp.GetInstances()[i].GetId()]; ok {
+			ret = append(ret, val)
+		}
+	}
+
+	return ret
+}
+
+func getService(url *common.URL) string {
+	applicationMode := false
+	for _, item := range config.GetRootConfig().Registries {
+		if item.Protocol == constant.PolarisKey {
+			applicationMode = item.RegistryType == constant.ServiceKey
+		}
+	}
+
+	service := "providers:" + url.Service()
+	if applicationMode {
+		service = config.GetApplicationConfig().Name
+	}
+
+	return service
+}
+
+func (p *polarisRouter) buildRouteRequest(svc string, url *common.URL,
+	invoaction protocol.Invocation) (polaris.ProcessRoutersRequest, error) {
+
+	routeReq := polaris.ProcessRoutersRequest{
+		ProcessRoutersRequest: model.ProcessRoutersRequest{
+			SourceService: model.ServiceInfo{
+				Metadata: map[string]string{},
+			},
+		},
+	}
+
+	attachement := invoaction.Attachments()
+	arguments := invoaction.Arguments()
+
+	labels, err := p.buildTrafficLabels(svc)
+	if err != nil {
+		return polaris.ProcessRoutersRequest{}, err
+	}
+
+	for i := range labels {
+		label := labels[i]
+		if strings.Compare(label, model.LabelKeyPath) == 0 {
+			routeReq.AddArguments(model.BuildPathArgument(getInvokeMethod(url, invoaction)))
+			continue
+		}
+		if strings.HasPrefix(label, model.LabelKeyHeader) {
+			if val, ok := attachement[strings.TrimPrefix(label, model.LabelKeyHeader)]; ok {
+				routeReq.SourceService.Metadata[label] = fmt.Sprintf("%+v", val)
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+		if strings.HasPrefix(label, model.LabelKeyQuery) {
+			if val := parser.ParseArgumentsByExpression(label, arguments); val != nil {
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+	}
+
+	return routeReq, nil
+}
+
+func (p *polarisRouter) buildTrafficLabels(svc string) ([]string, error) {
+	req := &model.GetServiceRuleRequest{}
+	req.Namespace = remotingpolaris.GetNamespace()
+	req.Service = svc
+	req.SetTimeout(time.Second)
+	engine := p.routerApi.SDKContext().GetEngine()
+	resp, err := engine.SyncGetServiceRule(model.EventRouting, req)
+	if err != nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule fail : %+v", req.GetNamespace(), req.GetService(), err)
+		return nil, err
+	}
+
+	if resp == nil || resp.GetValue() == nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule empty", req.GetNamespace(), req.GetService())
+		return nil, ErrorPolarisServiceRouteRuleEmpty
+	}
+
+	routeRule := resp.GetValue().(*v1.Routing)
+	labels := make([]string, 0, 4)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+
+	return labels, nil
+}
+
+func getInvokeMethod(url *common.URL, invoaction protocol.Invocation) string {

Review Comment:
   nit: invoaction -> invocation



##########
cluster/router/polaris/router.go:
##########
@@ -0,0 +1,314 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"strings"
+	"sync"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log/logger"
+
+	"github.com/polarismesh/polaris-go"
+	"github.com/polarismesh/polaris-go/pkg/model"
+	v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/cluster/router"
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/common/constant"
+	"dubbo.apache.org/dubbo-go/v3/config"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+	remotingpolaris "dubbo.apache.org/dubbo-go/v3/remoting/polaris"
+	"dubbo.apache.org/dubbo-go/v3/remoting/polaris/parser"
+)
+
+var (
+	_ router.PriorityRouter = (*polarisRouter)(nil)
+)
+
+var (
+	ErrorPolarisServiceRouteRuleEmpty = errors.New("service route rule is empty")
+)
+
+func newPolarisRouter() (*polarisRouter, error) {
+	routerApi, err := remotingpolaris.GetRouterAPI()
+	if err != nil {
+		return nil, err
+	}
+	consumerApi, err := remotingpolaris.GetConsumerAPI()
+	if err != nil {
+		return nil, err
+	}
+
+	return &polarisRouter{
+		routerApi:   routerApi,
+		consumerApi: consumerApi,
+	}, nil
+}
+
+type polarisRouter struct {
+	routerApi   polaris.RouterAPI
+	consumerApi polaris.ConsumerAPI

Review Comment:
   same above



##########
cluster/router/polaris/router.go:
##########
@@ -0,0 +1,314 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"strings"
+	"sync"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log/logger"
+
+	"github.com/polarismesh/polaris-go"
+	"github.com/polarismesh/polaris-go/pkg/model"
+	v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/cluster/router"
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/common/constant"
+	"dubbo.apache.org/dubbo-go/v3/config"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+	remotingpolaris "dubbo.apache.org/dubbo-go/v3/remoting/polaris"
+	"dubbo.apache.org/dubbo-go/v3/remoting/polaris/parser"
+)
+
+var (
+	_ router.PriorityRouter = (*polarisRouter)(nil)
+)
+
+var (
+	ErrorPolarisServiceRouteRuleEmpty = errors.New("service route rule is empty")
+)
+
+func newPolarisRouter() (*polarisRouter, error) {
+	routerApi, err := remotingpolaris.GetRouterAPI()
+	if err != nil {
+		return nil, err
+	}
+	consumerApi, err := remotingpolaris.GetConsumerAPI()
+	if err != nil {
+		return nil, err
+	}
+
+	return &polarisRouter{
+		routerApi:   routerApi,
+		consumerApi: consumerApi,
+	}, nil
+}
+
+type polarisRouter struct {
+	routerApi   polaris.RouterAPI

Review Comment:
   nit: routerApi -> routerAPI



##########
cluster/router/polaris/router.go:
##########
@@ -0,0 +1,314 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"strings"
+	"sync"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log/logger"
+
+	"github.com/polarismesh/polaris-go"
+	"github.com/polarismesh/polaris-go/pkg/model"
+	v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/cluster/router"
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/common/constant"
+	"dubbo.apache.org/dubbo-go/v3/config"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+	remotingpolaris "dubbo.apache.org/dubbo-go/v3/remoting/polaris"
+	"dubbo.apache.org/dubbo-go/v3/remoting/polaris/parser"
+)
+
+var (
+	_ router.PriorityRouter = (*polarisRouter)(nil)
+)
+
+var (
+	ErrorPolarisServiceRouteRuleEmpty = errors.New("service route rule is empty")
+)
+
+func newPolarisRouter() (*polarisRouter, error) {
+	routerApi, err := remotingpolaris.GetRouterAPI()
+	if err != nil {
+		return nil, err
+	}
+	consumerApi, err := remotingpolaris.GetConsumerAPI()
+	if err != nil {
+		return nil, err
+	}
+
+	return &polarisRouter{
+		routerApi:   routerApi,
+		consumerApi: consumerApi,
+	}, nil
+}
+
+type polarisRouter struct {
+	routerApi   polaris.RouterAPI
+	consumerApi polaris.ConsumerAPI
+
+	cancel context.CancelFunc
+
+	lock      sync.RWMutex
+	instances map[string]model.Instance
+}
+
+// Route Determine the target invokers list.
+func (p *polarisRouter) Route(invokers []protocol.Invoker, url *common.URL,
+	invoaction protocol.Invocation) []protocol.Invoker {
+
+	if len(invokers) == 0 {
+		logger.Warnf("[tag router] invokers from previous router is empty")
+		return invokers
+	}
+
+	service := getService(url)
+	instanceMap := p.buildInstanceMap(service)
+	if len(instanceMap) == 0 {
+		return invokers
+	}
+
+	invokersMap := make(map[string]protocol.Invoker, len(invokers))
+	targetIns := make([]model.Instance, 0, len(invokers))
+	for i := range invokers {
+		invoker := invokers[i]
+		instanceId := invoker.GetURL().GetParam(constant.PolarisInstanceID, "")
+		if len(instanceId) == 0 {
+			continue
+		}
+		invokersMap[instanceId] = invoker
+		if val, ok := instanceMap[instanceId]; ok {
+			targetIns = append(targetIns, val)
+		}
+	}
+
+	req, err := p.buildRouteRequest(service, url, invoaction)
+	if err != nil {
+		return invokers
+	}
+	req.DstInstances = model.NewDefaultServiceInstances(model.ServiceInfo{
+		Service:   service,
+		Namespace: remotingpolaris.GetNamespace(),
+	}, targetIns)
+
+	resp, err := p.routerApi.ProcessRouters(&req)
+	if err != nil {
+		return invokers
+	}
+
+	ret := make([]protocol.Invoker, 0, len(resp.GetInstances()))
+	for i := range resp.GetInstances() {
+		if val, ok := invokersMap[resp.GetInstances()[i].GetId()]; ok {
+			ret = append(ret, val)
+		}
+	}
+
+	return ret
+}
+
+func getService(url *common.URL) string {
+	applicationMode := false
+	for _, item := range config.GetRootConfig().Registries {
+		if item.Protocol == constant.PolarisKey {
+			applicationMode = item.RegistryType == constant.ServiceKey
+		}
+	}
+
+	service := "providers:" + url.Service()
+	if applicationMode {
+		service = config.GetApplicationConfig().Name
+	}
+
+	return service
+}
+
+func (p *polarisRouter) buildRouteRequest(svc string, url *common.URL,
+	invoaction protocol.Invocation) (polaris.ProcessRoutersRequest, error) {
+
+	routeReq := polaris.ProcessRoutersRequest{
+		ProcessRoutersRequest: model.ProcessRoutersRequest{
+			SourceService: model.ServiceInfo{
+				Metadata: map[string]string{},
+			},
+		},
+	}
+
+	attachement := invoaction.Attachments()
+	arguments := invoaction.Arguments()
+
+	labels, err := p.buildTrafficLabels(svc)
+	if err != nil {
+		return polaris.ProcessRoutersRequest{}, err
+	}
+
+	for i := range labels {
+		label := labels[i]
+		if strings.Compare(label, model.LabelKeyPath) == 0 {
+			routeReq.AddArguments(model.BuildPathArgument(getInvokeMethod(url, invoaction)))
+			continue
+		}
+		if strings.HasPrefix(label, model.LabelKeyHeader) {
+			if val, ok := attachement[strings.TrimPrefix(label, model.LabelKeyHeader)]; ok {
+				routeReq.SourceService.Metadata[label] = fmt.Sprintf("%+v", val)
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+		if strings.HasPrefix(label, model.LabelKeyQuery) {
+			if val := parser.ParseArgumentsByExpression(label, arguments); val != nil {
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+	}
+
+	return routeReq, nil
+}
+
+func (p *polarisRouter) buildTrafficLabels(svc string) ([]string, error) {
+	req := &model.GetServiceRuleRequest{}
+	req.Namespace = remotingpolaris.GetNamespace()
+	req.Service = svc
+	req.SetTimeout(time.Second)
+	engine := p.routerApi.SDKContext().GetEngine()
+	resp, err := engine.SyncGetServiceRule(model.EventRouting, req)
+	if err != nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule fail : %+v", req.GetNamespace(), req.GetService(), err)
+		return nil, err
+	}
+
+	if resp == nil || resp.GetValue() == nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule empty", req.GetNamespace(), req.GetService())
+		return nil, ErrorPolarisServiceRouteRuleEmpty
+	}
+
+	routeRule := resp.GetValue().(*v1.Routing)
+	labels := make([]string, 0, 4)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+
+	return labels, nil
+}
+
+func getInvokeMethod(url *common.URL, invoaction protocol.Invocation) string {
+	applicationMode := false
+	for _, item := range config.GetRootConfig().Registries {
+		if item.Protocol == constant.PolarisKey {
+			applicationMode = item.RegistryType == constant.ServiceKey
+		}
+	}
+
+	method := invoaction.MethodName()
+	if applicationMode {
+		method = url.Interface() + "/" + invoaction.MethodName()
+	}
+
+	return method
+}
+
+func collectRouteLabels(routings []*v1.Route) []string {
+	ret := make([]string, 0, 4)
+
+	for i := range routings {
+		route := routings[i]
+		sources := route.GetSources()
+		for p := range sources {
+			source := sources[p]
+			for k := range source.GetMetadata() {
+				ret = append(ret, k)
+			}
+		}
+	}
+
+	return ret
+}
+
+func (p *polarisRouter) buildInstanceMap(svc string) map[string]model.Instance {
+	resp, err := p.consumerApi.GetAllInstances(&polaris.GetAllInstancesRequest{
+		GetAllInstancesRequest: model.GetAllInstancesRequest{
+			Service:   svc,
+			Namespace: remotingpolaris.GetNamespace(),
+		},
+	})
+	if err != nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get all instances fail : %+v", remotingpolaris.GetNamespace(), svc, err)
+		return nil
+	}
+
+	ret := make(map[string]model.Instance, len(resp.GetInstances()))
+
+	for i := range resp.GetInstances() {
+		ret[resp.GetInstances()[i].GetId()] = resp.GetInstances()[i]
+	}
+
+	return ret
+}
+
+// URL Return URL in router
+func (p *polarisRouter) URL() *common.URL {
+	return nil
+}
+
+// Priority Return Priority in router
+// 0 to ^int(0) is better
+func (p *polarisRouter) Priority() int64 {
+	return 0

Review Comment:
   Is priority not available for now?



##########
cluster/router/polaris/router.go:
##########
@@ -0,0 +1,314 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"strings"
+	"sync"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log/logger"
+
+	"github.com/polarismesh/polaris-go"
+	"github.com/polarismesh/polaris-go/pkg/model"
+	v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/cluster/router"
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/common/constant"
+	"dubbo.apache.org/dubbo-go/v3/config"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+	remotingpolaris "dubbo.apache.org/dubbo-go/v3/remoting/polaris"
+	"dubbo.apache.org/dubbo-go/v3/remoting/polaris/parser"
+)
+
+var (
+	_ router.PriorityRouter = (*polarisRouter)(nil)
+)
+
+var (
+	ErrorPolarisServiceRouteRuleEmpty = errors.New("service route rule is empty")
+)
+
+func newPolarisRouter() (*polarisRouter, error) {
+	routerApi, err := remotingpolaris.GetRouterAPI()
+	if err != nil {
+		return nil, err
+	}
+	consumerApi, err := remotingpolaris.GetConsumerAPI()
+	if err != nil {
+		return nil, err
+	}
+
+	return &polarisRouter{
+		routerApi:   routerApi,
+		consumerApi: consumerApi,
+	}, nil
+}
+
+type polarisRouter struct {
+	routerApi   polaris.RouterAPI
+	consumerApi polaris.ConsumerAPI
+
+	cancel context.CancelFunc
+
+	lock      sync.RWMutex
+	instances map[string]model.Instance
+}
+
+// Route Determine the target invokers list.
+func (p *polarisRouter) Route(invokers []protocol.Invoker, url *common.URL,
+	invoaction protocol.Invocation) []protocol.Invoker {
+
+	if len(invokers) == 0 {
+		logger.Warnf("[tag router] invokers from previous router is empty")
+		return invokers
+	}
+
+	service := getService(url)
+	instanceMap := p.buildInstanceMap(service)
+	if len(instanceMap) == 0 {
+		return invokers
+	}
+
+	invokersMap := make(map[string]protocol.Invoker, len(invokers))
+	targetIns := make([]model.Instance, 0, len(invokers))
+	for i := range invokers {
+		invoker := invokers[i]
+		instanceId := invoker.GetURL().GetParam(constant.PolarisInstanceID, "")

Review Comment:
   nit: instanceId -> instanceID



##########
cluster/router/polaris/router.go:
##########
@@ -0,0 +1,314 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"strings"
+	"sync"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log/logger"
+
+	"github.com/polarismesh/polaris-go"
+	"github.com/polarismesh/polaris-go/pkg/model"
+	v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/cluster/router"
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/common/constant"
+	"dubbo.apache.org/dubbo-go/v3/config"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+	remotingpolaris "dubbo.apache.org/dubbo-go/v3/remoting/polaris"
+	"dubbo.apache.org/dubbo-go/v3/remoting/polaris/parser"
+)
+
+var (
+	_ router.PriorityRouter = (*polarisRouter)(nil)
+)
+
+var (
+	ErrorPolarisServiceRouteRuleEmpty = errors.New("service route rule is empty")
+)
+
+func newPolarisRouter() (*polarisRouter, error) {
+	routerApi, err := remotingpolaris.GetRouterAPI()
+	if err != nil {
+		return nil, err
+	}
+	consumerApi, err := remotingpolaris.GetConsumerAPI()
+	if err != nil {
+		return nil, err
+	}
+
+	return &polarisRouter{
+		routerApi:   routerApi,
+		consumerApi: consumerApi,
+	}, nil
+}
+
+type polarisRouter struct {
+	routerApi   polaris.RouterAPI
+	consumerApi polaris.ConsumerAPI
+
+	cancel context.CancelFunc
+
+	lock      sync.RWMutex
+	instances map[string]model.Instance
+}
+
+// Route Determine the target invokers list.
+func (p *polarisRouter) Route(invokers []protocol.Invoker, url *common.URL,
+	invoaction protocol.Invocation) []protocol.Invoker {
+
+	if len(invokers) == 0 {
+		logger.Warnf("[tag router] invokers from previous router is empty")
+		return invokers
+	}
+
+	service := getService(url)
+	instanceMap := p.buildInstanceMap(service)
+	if len(instanceMap) == 0 {
+		return invokers
+	}
+
+	invokersMap := make(map[string]protocol.Invoker, len(invokers))
+	targetIns := make([]model.Instance, 0, len(invokers))
+	for i := range invokers {
+		invoker := invokers[i]
+		instanceId := invoker.GetURL().GetParam(constant.PolarisInstanceID, "")
+		if len(instanceId) == 0 {
+			continue
+		}
+		invokersMap[instanceId] = invoker
+		if val, ok := instanceMap[instanceId]; ok {
+			targetIns = append(targetIns, val)
+		}
+	}
+
+	req, err := p.buildRouteRequest(service, url, invoaction)
+	if err != nil {
+		return invokers
+	}
+	req.DstInstances = model.NewDefaultServiceInstances(model.ServiceInfo{
+		Service:   service,
+		Namespace: remotingpolaris.GetNamespace(),
+	}, targetIns)
+
+	resp, err := p.routerApi.ProcessRouters(&req)
+	if err != nil {
+		return invokers
+	}
+
+	ret := make([]protocol.Invoker, 0, len(resp.GetInstances()))
+	for i := range resp.GetInstances() {
+		if val, ok := invokersMap[resp.GetInstances()[i].GetId()]; ok {
+			ret = append(ret, val)
+		}
+	}
+
+	return ret
+}
+
+func getService(url *common.URL) string {
+	applicationMode := false
+	for _, item := range config.GetRootConfig().Registries {
+		if item.Protocol == constant.PolarisKey {
+			applicationMode = item.RegistryType == constant.ServiceKey
+		}
+	}
+
+	service := "providers:" + url.Service()
+	if applicationMode {
+		service = config.GetApplicationConfig().Name
+	}
+
+	return service
+}
+
+func (p *polarisRouter) buildRouteRequest(svc string, url *common.URL,
+	invoaction protocol.Invocation) (polaris.ProcessRoutersRequest, error) {
+
+	routeReq := polaris.ProcessRoutersRequest{
+		ProcessRoutersRequest: model.ProcessRoutersRequest{
+			SourceService: model.ServiceInfo{
+				Metadata: map[string]string{},
+			},
+		},
+	}
+
+	attachement := invoaction.Attachments()
+	arguments := invoaction.Arguments()
+
+	labels, err := p.buildTrafficLabels(svc)
+	if err != nil {
+		return polaris.ProcessRoutersRequest{}, err
+	}
+
+	for i := range labels {
+		label := labels[i]
+		if strings.Compare(label, model.LabelKeyPath) == 0 {
+			routeReq.AddArguments(model.BuildPathArgument(getInvokeMethod(url, invoaction)))
+			continue
+		}
+		if strings.HasPrefix(label, model.LabelKeyHeader) {
+			if val, ok := attachement[strings.TrimPrefix(label, model.LabelKeyHeader)]; ok {
+				routeReq.SourceService.Metadata[label] = fmt.Sprintf("%+v", val)
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+		if strings.HasPrefix(label, model.LabelKeyQuery) {
+			if val := parser.ParseArgumentsByExpression(label, arguments); val != nil {
+				routeReq.AddArguments(model.BuildArgumentFromLabel(label, fmt.Sprintf("%+v", val)))
+			}
+		}
+	}
+
+	return routeReq, nil
+}
+
+func (p *polarisRouter) buildTrafficLabels(svc string) ([]string, error) {
+	req := &model.GetServiceRuleRequest{}
+	req.Namespace = remotingpolaris.GetNamespace()
+	req.Service = svc
+	req.SetTimeout(time.Second)
+	engine := p.routerApi.SDKContext().GetEngine()
+	resp, err := engine.SyncGetServiceRule(model.EventRouting, req)
+	if err != nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule fail : %+v", req.GetNamespace(), req.GetService(), err)
+		return nil, err
+	}
+
+	if resp == nil || resp.GetValue() == nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get route rule empty", req.GetNamespace(), req.GetService())
+		return nil, ErrorPolarisServiceRouteRuleEmpty
+	}
+
+	routeRule := resp.GetValue().(*v1.Routing)
+	labels := make([]string, 0, 4)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+	labels = append(labels, collectRouteLabels(routeRule.GetInbounds())...)
+
+	return labels, nil
+}
+
+func getInvokeMethod(url *common.URL, invoaction protocol.Invocation) string {
+	applicationMode := false
+	for _, item := range config.GetRootConfig().Registries {
+		if item.Protocol == constant.PolarisKey {
+			applicationMode = item.RegistryType == constant.ServiceKey
+		}
+	}
+
+	method := invoaction.MethodName()
+	if applicationMode {
+		method = url.Interface() + "/" + invoaction.MethodName()
+	}
+
+	return method
+}
+
+func collectRouteLabels(routings []*v1.Route) []string {
+	ret := make([]string, 0, 4)
+
+	for i := range routings {
+		route := routings[i]
+		sources := route.GetSources()
+		for p := range sources {
+			source := sources[p]
+			for k := range source.GetMetadata() {
+				ret = append(ret, k)
+			}
+		}
+	}
+
+	return ret
+}
+
+func (p *polarisRouter) buildInstanceMap(svc string) map[string]model.Instance {
+	resp, err := p.consumerApi.GetAllInstances(&polaris.GetAllInstancesRequest{
+		GetAllInstancesRequest: model.GetAllInstancesRequest{
+			Service:   svc,
+			Namespace: remotingpolaris.GetNamespace(),
+		},
+	})
+	if err != nil {
+		logger.Errorf("[Router][Polaris] ns:%s svc:%s get all instances fail : %+v", remotingpolaris.GetNamespace(), svc, err)
+		return nil
+	}
+
+	ret := make(map[string]model.Instance, len(resp.GetInstances()))
+
+	for i := range resp.GetInstances() {
+		ret[resp.GetInstances()[i].GetId()] = resp.GetInstances()[i]
+	}
+
+	return ret
+}
+
+// URL Return URL in router
+func (p *polarisRouter) URL() *common.URL {
+	return nil

Review Comment:
   Why here returns a nil?



-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] sonarcloud[bot] commented on pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#issuecomment-1327986081

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=2132)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132) No Coverage information  
   [![0.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.5%')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list) [0.5% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] jasondeng1997 commented on a diff in pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
jasondeng1997 commented on code in PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#discussion_r1031973040


##########
cluster/router/polaris/involer.go:
##########
@@ -0,0 +1,175 @@
+/*
+ * 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 polaris
+
+import (
+	"context"
+)
+
+import (
+	"github.com/polarismesh/polaris-go/pkg/model"
+)
+
+import (
+	"dubbo.apache.org/dubbo-go/v3/common"
+	"dubbo.apache.org/dubbo-go/v3/protocol"
+)
+
+var (
+	_ model.Instance   = (*polarisInvoker)(nil)
+	_ protocol.Invoker = (*polarisInvoker)(nil)
+)
+
+func newPolarisInvoker(invoker protocol.Invoker) *polarisInvoker {
+	p := &polarisInvoker{invoker: invoker}
+	return p
+}
+
+type polarisInvoker struct {
+	invoker protocol.Invoker
+	ins     model.Instance
+}
+
+// GetInstanceKey 获取实例四元组标识
+func (p *polarisInvoker) GetInstanceKey() model.InstanceKey {
+	return p.ins.GetInstanceKey()
+}
+
+// GetNamespace 实例所在命名空间
+func (p *polarisInvoker) GetNamespace() string {
+	return p.ins.GetNamespace()
+}
+
+// GetService 实例所在服务名
+func (p *polarisInvoker) GetService() string {
+	return p.ins.GetService()
+}
+
+// GetId 服务实例唯一标识
+func (p *polarisInvoker) GetId() string {
+	return p.ins.GetId()
+}
+
+// GetHost 实例的域名/IP信息
+func (p *polarisInvoker) GetHost() string {
+	return p.ins.GetHost()
+}
+
+// GetPort 实例的监听端口
+func (p *polarisInvoker) GetPort() uint32 {
+	return p.ins.GetPort()
+}
+
+// GetVpcId 实例的vpcId
+func (p *polarisInvoker) GetVpcId() string {
+	return p.ins.GetVpcId()
+}
+
+// GetProtocol 服务实例的协议
+func (p *polarisInvoker) GetProtocol() string {
+	return p.ins.GetProtocol()
+}
+
+// GetVersion 实例版本号
+func (p *polarisInvoker) GetVersion() string {
+	return p.ins.GetVersion()
+}
+
+// GetWeight 实例静态权重值
+func (p *polarisInvoker) GetWeight() int {
+	return p.ins.GetWeight()
+}
+
+// GetPriority 实例优先级信息
+func (p *polarisInvoker) GetPriority() uint32 {
+	return p.ins.GetPriority()
+}
+
+// GetMetadata 实例元数据信息
+func (p *polarisInvoker) GetMetadata() map[string]string {
+	return p.ins.GetMetadata()
+}
+
+// GetLogicSet 实例逻辑分区
+func (p *polarisInvoker) GetLogicSet() string {
+	return p.ins.GetLogicSet()
+}
+
+// GetCircuitBreakerStatus 实例的断路器状态,包括:
+// 打开(被熔断)、半开(探测恢复)、关闭(正常运行)
+func (p *polarisInvoker) GetCircuitBreakerStatus() model.CircuitBreakerStatus {
+	return p.ins.GetCircuitBreakerStatus()
+}
+
+// IsHealthy 实例是否健康,基于服务端返回的健康数据

Review Comment:
   不加中文注释吧



-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] codecov-commenter commented on pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#issuecomment-1325968820

   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/2132?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2132](https://codecov.io/gh/apache/dubbo-go/pull/2132?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ecd21cc) into [master](https://codecov.io/gh/apache/dubbo-go/commit/9e4452a596f035efff9503312111ef77b4363178?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9e4452a) will **decrease** coverage by `0.17%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head ecd21cc differs from pull request most recent head 2ce51b0. Consider uploading reports for the commit 2ce51b0 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #2132      +/-   ##
   ==========================================
   - Coverage   44.51%   44.34%   -0.18%     
   ==========================================
     Files         283      283              
     Lines       17015    17015              
   ==========================================
   - Hits         7574     7545      -29     
   - Misses       8646     8677      +31     
   + Partials      795      793       -2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/2132?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/2132/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `26.49% <0.00%> (-15.90%)` | :arrow_down: |
   | [...tocol/rest/server/server\_impl/go\_restful\_server.go](https://codecov.io/gh/apache/dubbo-go/pull/2132/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJvdG9jb2wvcmVzdC9zZXJ2ZXIvc2VydmVyX2ltcGwvZ29fcmVzdGZ1bF9zZXJ2ZXIuZ28=) | `41.37% <0.00%> (-3.45%)` | :arrow_down: |
   | [metrics/prometheus/reporter.go](https://codecov.io/gh/apache/dubbo-go/pull/2132/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0cmljcy9wcm9tZXRoZXVzL3JlcG9ydGVyLmdv) | `30.25% <0.00%> (-1.54%)` | :arrow_down: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] sonarcloud[bot] commented on pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#issuecomment-1323194077

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=2132)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132) No Coverage information  
   [![0.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.4%')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list) [0.4% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] sonarcloud[bot] commented on pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#issuecomment-1325968755

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=2132)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132) No Coverage information  
   [![0.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.4%')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list) [0.4% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] sonarcloud[bot] commented on pull request #2132: [ISSUE #2124] feat:support polaris router ability

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #2132:
URL: https://github.com/apache/dubbo-go/pull/2132#issuecomment-1327983008

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=2132)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=2132&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132) No Coverage information  
   [![0.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.5%')](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list) [0.5% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=2132&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org