Skip to content

Commit

Permalink
fix:issue apache#2216
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed Mar 5, 2023
1 parent b492dba commit ced042d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 2 additions & 0 deletions common/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ import (
gxset "github.com/dubbogo/gost/container/set"

"github.com/google/uuid"

"github.com/jinzhu/copier"

perrors "github.com/pkg/errors"
)

Expand Down
1 change: 1 addition & 0 deletions config/metric_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package config

import (
"github.com/creasty/defaults"

"github.com/dubbogo/gost/log/logger"

"github.com/pkg/errors"
Expand Down
7 changes: 6 additions & 1 deletion registry/polaris/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,17 @@ func createRegisterParam(url *common.URL, serviceName string) *api.InstanceRegis

ver := url.GetParam("version", "")

protocolVal := protocolForDubboGO
if len(url.Protocol) != 0 {
protocolVal = url.Protocol
}

req := &api.InstanceRegisterRequest{
InstanceRegisterRequest: model.InstanceRegisterRequest{
Service: serviceName,
Host: url.Ip,
Port: port,
Protocol: &protocolForDubboGO,
Protocol: &protocolVal,
Version: &ver,
Metadata: metadata,
},
Expand Down
11 changes: 7 additions & 4 deletions registry/polaris/service_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,20 @@ func (polaris *polarisServiceDiscovery) String() string {

func convertToRegisterInstance(namespace string, instance registry.ServiceInstance) *api.InstanceRegisterRequest {

health := instance.IsHealthy()
isolate := instance.IsEnable()
ttl := 5
var (
health = instance.IsHealthy()
isolate = instance.IsEnable()
ttl = 5
protocolVal = protocolForDubboGO
)

return &api.InstanceRegisterRequest{
InstanceRegisterRequest: model.InstanceRegisterRequest{
Service: instance.GetServiceName(),
Namespace: namespace,
Host: instance.GetHost(),
Port: instance.GetPort(),
Protocol: &protocolForDubboGO,
Protocol: &protocolVal,
Metadata: instance.GetMetadata(),
Healthy: &health,
Isolate: &isolate,
Expand Down
5 changes: 5 additions & 0 deletions remoting/zookeeper/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ import (
"sync"
"time"
)

import (
"github.com/dubbogo/go-zookeeper/zk"

gxzookeeper "github.com/dubbogo/gost/database/kv/zk"
"github.com/dubbogo/gost/log/logger"

perrors "github.com/pkg/errors"

uatomic "go.uber.org/atomic"
)

import (
"dubbo.apache.org/dubbo-go/v3/common"
"dubbo.apache.org/dubbo-go/v3/common/constant"
Expand Down

0 comments on commit ced042d

Please sign in to comment.