Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
38b7dd8d
Commit
38b7dd8d
authored
5 years ago
by
Huxing Zhang
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #94 from hxmhlt/master
Fix: for p2p bug
parents
b719cb8a
1ba803a5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
README_CN.md
+1
-1
1 addition, 1 deletion
README_CN.md
config/service_config.go
+24
-12
24 additions, 12 deletions
config/service_config.go
with
26 additions
and
14 deletions
README.md
+
1
−
1
View file @
38b7dd8d
...
...
@@ -37,7 +37,7 @@ Finished List:
Working List:
-
Cluster Strategy: Failfast/Failsafe/Failback/Forking
-
Load Balance:
RoundRobin/LeastActive/
ConsistentHash
-
Load Balance: ConsistentHash
-
Filter: TokenFilter/AccessLogFilter/CountFilter/ActiveLimitFilter/ExecuteLimitFilter/GenericFilter/TpsLimitFilter
-
Registry: etcd/k8s/consul
...
...
This diff is collapsed.
Click to expand it.
README_CN.md
+
1
−
1
View file @
38b7dd8d
...
...
@@ -37,7 +37,7 @@ Apache License, Version 2.0
开发中列表:
-
Cluster Strategy: Failfast/Failsafe/Failback/Forking
-
Load Balance:
RoundRobin/LeastActive/
ConsistentHash
-
Load Balance: ConsistentHash
-
Filter: TokenFilter/AccessLogFilter/CountFilter/ActiveLimitFilter/ExecuteLimitFilter/GenericFilter/TpsLimitFilter
-
Registry: etcd/k8s/consul
...
...
This diff is collapsed.
Click to expand it.
config/service_config.go
+
24
−
12
View file @
38b7dd8d
...
...
@@ -19,6 +19,7 @@ package config
import
(
"context"
"fmt"
"net/url"
"strconv"
"strings"
...
...
@@ -37,6 +38,7 @@ import (
"github.com/apache/dubbo-go/common/extension"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/protocol/protocolwrapper"
)
type
ServiceConfig
struct
{
...
...
@@ -109,23 +111,33 @@ func (srvconfig *ServiceConfig) Export() error {
common
.
WithParams
(
urlMap
),
common
.
WithMethods
(
strings
.
Split
(
methods
,
","
)))
for
_
,
regUrl
:=
range
regUrls
{
regUrl
.
SubURL
=
url
srvconfig
.
cacheMutex
.
Lock
()
if
srvconfig
.
cacheProtocol
==
nil
{
logger
.
Infof
(
"First load the registry protocol!"
)
srvconfig
.
cacheProtocol
=
extension
.
GetProtocol
(
"registry"
)
if
len
(
regUrls
)
>
0
{
for
_
,
regUrl
:=
range
regUrls
{
regUrl
.
SubURL
=
url
srvconfig
.
cacheMutex
.
Lock
()
if
srvconfig
.
cacheProtocol
==
nil
{
logger
.
Infof
(
fmt
.
Sprintf
(
"First load the registry protocol , url is {%v}!"
,
url
))
srvconfig
.
cacheProtocol
=
extension
.
GetProtocol
(
"registry"
)
}
srvconfig
.
cacheMutex
.
Unlock
()
invoker
:=
extension
.
GetProxyFactory
(
providerConfig
.
ProxyFactory
)
.
GetInvoker
(
*
regUrl
)
exporter
:=
srvconfig
.
cacheProtocol
.
Export
(
invoker
)
if
exporter
==
nil
{
panic
(
perrors
.
New
(
fmt
.
Sprintf
(
"Registry protocol new exporter error,registry is {%v},url is {%v}"
,
regUrl
,
url
)))
}
srvconfig
.
exporters
=
append
(
srvconfig
.
exporters
,
exporter
)
}
srvconfig
.
cacheMutex
.
Unlock
()
invoker
:=
extension
.
GetProxyFactory
(
providerConfig
.
ProxyFactory
)
.
GetInvoker
(
*
regUrl
)
exporter
:=
srvconfig
.
cacheProtocol
.
Export
(
invoker
)
}
else
{
invoker
:=
extension
.
GetProxyFactory
(
providerConfig
.
ProxyFactory
)
.
GetInvoker
(
*
url
)
exporter
:=
extension
.
GetProtocol
(
protocolwrapper
.
FILTER
)
.
Export
(
invoker
)
if
exporter
==
nil
{
panic
(
perrors
.
New
(
"New exporter error"
))
panic
(
perrors
.
New
(
fmt
.
Sprintf
(
"Filter protocol without registry new exporter error,url is {%v}"
,
url
)
))
}
srvconfig
.
exporters
=
append
(
srvconfig
.
exporters
,
exporter
)
}
}
return
nil
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment