Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) ServiceDiscoveryRegistry implementation #491

Closed
wants to merge 141 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
f09c991
Add extensiong for metadata service
Apr 15, 2020
f1de848
Merge pull request #484 from apache/1.4
wongoo Apr 20, 2020
ad18357
Merge pull request #1 from apache/feature/dubbo-2.7.5
lzp0412 Apr 22, 2020
5811136
Merge remote-tracking branch 'origin/feature/dubbo-2.7.5' into featur…
Apr 22, 2020
ae7d706
support service discovery registry
Apr 24, 2020
8022392
fix synthesizer bug
Apr 24, 2020
9cbee58
add .asf.yaml to change gitbox behaviour
htynkn Apr 29, 2020
8a3c02c
Update .asf.yaml
htynkn Apr 29, 2020
71326c9
Merge branch 'feature/dubbo-2.7.5' of https://github.com/lzp0412/dubb…
May 1, 2020
682f405
Add dynamic
May 1, 2020
a5da721
rename service => service discovery
May 1, 2020
8b720aa
Merge develop
May 1, 2020
3aa0082
Merge pull request #2 from flycash/2.7.5-bk
lzp0412 May 1, 2020
569e2b6
1、add comments
May 1, 2020
212d886
merge develop
May 2, 2020
ffe69ca
Merge branch 'feature/dubbo-2.7.5' of github.com:apache/dubbo-go into…
May 2, 2020
08eb340
Export get BaseConfig
May 2, 2020
bcda4de
fix review comments
May 2, 2020
698c2b2
Merge remote-tracking branch 'remotes/dubbo-go/feature/dubbo-2.7.5' i…
May 2, 2020
4b8b4d7
Refactor service-discovery
May 4, 2020
1113bf1
Merge 2.7.5
May 4, 2020
3f1a52b
Merge pull request #4 from flycash/2.7.5-bk
lzp0412 May 4, 2020
731020d
add comments for directory
May 5, 2020
2264cda
add comments for directory
May 5, 2020
a784557
Add tests
May 5, 2020
266e0b6
Add extensiong for metadata service
Apr 15, 2020
ed5693f
Merge pull request #5 from flycash/2.7.5-bk
lzp0412 May 5, 2020
fc6bdfa
Modify the comment of Process method
May 6, 2020
ea89aec
add the comment of ConsistentHash
May 7, 2020
861a9cd
provider can get attachment in ctx
pantianying May 8, 2020
c6be554
fix
pantianying May 8, 2020
9fb89ed
add the comment of ConsistentHash
May 10, 2020
7df8822
fix
May 10, 2020
e73f3bf
fix impl_test error
May 11, 2020
2e0e802
delete meaningless code
pantianying May 12, 2020
393d12a
fix import error
May 12, 2020
aaeabc6
fix import error
May 12, 2020
d82e10f
fix ut
pantianying May 14, 2020
84b38fe
Merge pull request #508 from pantianying/provider_getattachment_in_co…
AlexStocks May 15, 2020
544036a
Merge pull request #1 from apache/develop
xianlezheng May 16, 2020
ebb1b0c
Fix “compile errors caused by unsupported import packages”
xianlezheng May 16, 2020
f87a292
fix
May 17, 2020
cb9045c
Fix “uncheck travis rules of go fmt”
xianlezheng May 17, 2020
1433347
replace Uint32Slice
May 17, 2020
b22fc9f
replace Uint32Slice
May 17, 2020
99f6cf4
Merge pull request #515 from xianlezheng/develop
flycash May 17, 2020
1737904
Merge pull request #506 from aliiohs/featue/addCommentForConsistentHash
AlexStocks May 18, 2020
dd2ff3e
remove lock from url
May 18, 2020
0f64e2c
format code
May 19, 2020
7a256e4
Merge pull request #4 from apache/develop
sxllwx May 19, 2020
ceba6d7
Wait for test
sxllwx May 19, 2020
6b53a98
delete lot of stage, direct used one-stage
sxllwx May 19, 2020
6bce310
push to test
sxllwx May 19, 2020
5835e3c
reinit integrate test case
sxllwx May 19, 2020
1c20fea
add main func for protocol/grpc/protoc-gen-dubbo/examples
sxllwx May 19, 2020
496610a
Add integrate-test
sxllwx May 19, 2020
47b9666
Fix travis integrate test case filepath mistake
sxllwx May 19, 2020
b6a5888
Drop ci-consumer unused package
sxllwx May 19, 2020
c109d8f
Add ci used current commit id
sxllwx May 19, 2020
9a68bb4
Fix dockerfile mistake, and fast fail
sxllwx May 19, 2020
385f267
Add more rich debug log
sxllwx May 19, 2020
a14978e
Fix to used travis env direct
sxllwx May 19, 2020
4866c0c
Add check travis env
sxllwx May 19, 2020
eb46ba9
Fix dockerfile and build the latest code
sxllwx May 19, 2020
7a225fc
Sync latest travis config
sxllwx May 19, 2020
06a543b
Drop ci-consumer go.sum
sxllwx May 19, 2020
f83dade
Fix docker build multi args
sxllwx May 19, 2020
dc27a11
Delete used debug info
sxllwx May 19, 2020
df1a43d
Finish code
May 19, 2020
8e9c2b2
Fix mistake according comment
sxllwx May 20, 2020
a519203
Update go-client config
sxllwx May 20, 2020
b39f876
Update go-server config
sxllwx May 20, 2020
ea81831
Merge pull request #520 from sxllwx/docker_ci
AlexStocks May 20, 2020
3afc4ba
Merge remote-tracking branch 'remotes/upstream/develop' into feature/…
May 20, 2020
71517ef
change go.mod
May 20, 2020
d1e5463
change comments
May 21, 2020
1df1165
feat: fix gitee code analysis shadow err
May 21, 2020
6f326a5
Add comments for common directory
watermelo May 21, 2020
8ffc312
Opt: optimize url to string
watermelo May 21, 2020
8822f2c
fmt the codes
watermelo May 21, 2020
f07be5c
Merge pull request #502 from aliiohs/feature/addCommentForMethod
zouyx May 21, 2020
8581202
Fix ci bug
sxllwx May 21, 2020
60ff0c4
Merge pull request #5 from apache/develop
sxllwx May 21, 2020
9190c53
Merge branch 'develop' into docker_ci
sxllwx May 21, 2020
f9368d5
Add extra logic for Dockerfile
sxllwx May 21, 2020
01ba749
Fix shell script name
sxllwx May 21, 2020
b0a1a4e
Fix Dockerfile BUG
sxllwx May 21, 2020
fd9fb38
Finish docker integrate ci
sxllwx May 21, 2020
cbb469e
Merge pull request #532 from sxllwx/docker_ci
sxllwx May 21, 2020
4c2907b
Revert "Fix docker ci bug"
sxllwx May 21, 2020
681a3fd
Merge pull request #533 from apache/revert-532-docker_ci
zouyx May 21, 2020
dcb4cc2
Merge pull request #6 from apache/develop
sxllwx May 21, 2020
bc76c31
local test pass
sxllwx May 21, 2020
455eb4d
local test pass, and sync latest develop code
sxllwx May 21, 2020
2a9b5fe
Merge pull request #534 from sxllwx/docker_ci
zouyx May 22, 2020
168f944
Merge pull request #531 from watermelo/featue/optUrlToString
AlexStocks May 22, 2020
47bba48
Opt: optimize error handling
watermelo May 22, 2020
def16af
Modify the order of import packages
watermelo May 22, 2020
2ffbe96
Mod: modify the comments in the directory of common
watermelo May 22, 2020
1800a67
feat: change %s to %+v
May 22, 2020
fdf51a1
Merge pull request #529 from georgehao/feat/issue514-fix-shadow-analysis
zouyx May 22, 2020
ed4e7ba
Modify the order of import packages
watermelo May 22, 2020
d3540d3
Merge branch 'featue/optLog' of https://github.com/watermelo/dubbo-go…
watermelo May 22, 2020
6489acf
Mod: modify inappropriate comments after review
watermelo May 22, 2020
f763779
Merge develop and resolve conflict
May 23, 2020
d2eee54
Merge pull request #519 from flycash/remove-url-lock
flycash May 23, 2020
67e8e41
add attribute into Invocation
cvictory May 24, 2020
9659d25
Mod: modify inappropriate comments after review & merge develop branch
watermelo May 24, 2020
5246e56
add default value of attribute
cvictory May 24, 2020
51ec3df
Mod: modify inappropriate comments after review & merge develop branch
watermelo May 24, 2020
d0a770f
Merge branch 'featue/addCommentForCommon' of https://github.com/water…
watermelo May 24, 2020
9432c7a
Merge pull request #530 from watermelo/featue/addCommentForCommon
zouyx May 24, 2020
8c8c95c
Merge pull request #536 from watermelo/featue/optLog
fangyincheng May 25, 2020
41c9d89
fix review issue: add default construct in
cvictory May 28, 2020
39a84d9
Merge pull request #537 from cvictory/attribute_into_invocation
AlexStocks May 28, 2020
7c87c2a
Merge branch 'feature/dubbo-2.7.5' of https://github.com/apache/dubbo…
flycash May 29, 2020
bdd9b71
Add UT
flycash May 29, 2020
198ddc3
Merge nacos-meta
flycash May 29, 2020
7e912e7
Merge pull request #6 from flycash/2.7.5
lzp0412 May 30, 2020
b968f7b
Add unregiste implementation
flycash May 30, 2020
517b521
Add comments for config_center
z2z23n0 May 29, 2020
7d4f1ed
Merge pull request #545 from YuzeZhang/master
zouyx May 30, 2020
cc4d563
server start successfully
flycash May 30, 2020
bfb89b5
Merge pull request #8 from flycash/2.7.5
lzp0412 May 30, 2020
035d7d9
Fix bug: using EventPublishServiceDiscovery
flycash May 31, 2020
f993803
Merge develop
flycash May 31, 2020
34775e5
Merge pull request #9 from flycash/2.7.5-bk
lzp0412 May 31, 2020
b760621
Add events and eventListener
flycash Jun 2, 2020
ed6b59b
Add events and eventListener
flycash Jun 2, 2020
e2da137
Add customizer
flycash Jun 3, 2020
59eee39
Add customizer
flycash Jun 3, 2020
2997c11
refactor MetadataService
flycash Jun 5, 2020
16b6500
it can be found by java consumer
flycash Jun 7, 2020
a7d16a0
Resolve conflict
flycash Jun 7, 2020
3984ffa
Merge branch 'feature/dubbo-2.7.5' into 2.7.5-bk
lzp0412 Jun 7, 2020
41615c3
Merge pull request #11 from flycash/2.7.5-bk
lzp0412 Jun 7, 2020
066dcdd
Add metadata service factory
flycash Jun 8, 2020
61a5188
Merge branch '2.7.5-bk' of github.com:flycash/dubbo-go into 2.7.5-bk
flycash Jun 8, 2020
658c0b9
Merge pull request #12 from flycash/2.7.5-bk
lzp0412 Jun 9, 2020
9d5d9e3
Invoke dubbo client success
flycash Jun 10, 2020
7019888
Merge pull request #13 from flycash/2.7.5-bk
lzp0412 Jun 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
notifications:
commits: commits@dubbo.apache.org
issues: notifications@dubbo.apache.org
pullrequests: notifications@dubbo.apache.org
jira_options: link label link label
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
language: go
dist: trusty
sudo: required

# define the dependence env
language: go
os:
- linux

go:
- "1.13"

services:
- docker
env:
- GO111MODULE=on

install: true

# define ci-stage
script:
# license-check
- echo 'start license check'
- go fmt ./... && [[ -z `git status -s` ]]
- sh before_validate_license.sh
- chmod u+x /tmp/tools/license/license-header-checker
- /tmp/tools/license/license-header-checker -v -a -r -i vendor /tmp/tools/license/license.txt . go && [[ -z `git status -s` ]]
# unit-test
- echo 'start unit-test'
- chmod u+x before_ut.sh && ./before_ut.sh
- go mod vendor && go test ./... -coverprofile=coverage.txt -covermode=atomic
# integrate-test
- chmod +x integrate_test.sh && ./integrate_test.sh

after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
6 changes: 3 additions & 3 deletions cluster/cluster_impl/available_cluster_invoker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var (
availableUrl, _ = common.NewURL("dubbo://192.168.1.1:20000/com.ikurento.user.UserProvider")
)

func registerAvailable(t *testing.T, invoker *mock.MockInvoker) protocol.Invoker {
func registerAvailable(invoker *mock.MockInvoker) protocol.Invoker {
extension.SetLoadbalance("random", loadbalance.NewRandomLoadBalance)
availableCluster := NewAvailableCluster()

Expand All @@ -60,7 +60,7 @@ func TestAvailableClusterInvokerSuccess(t *testing.T) {
defer ctrl.Finish()

invoker := mock.NewMockInvoker(ctrl)
clusterInvoker := registerAvailable(t, invoker)
clusterInvoker := registerAvailable(invoker)

mockResult := &protocol.RPCResult{Rest: rest{tried: 0, success: true}}
invoker.EXPECT().IsAvailable().Return(true)
Expand All @@ -76,7 +76,7 @@ func TestAvailableClusterInvokerNoAvail(t *testing.T) {
defer ctrl.Finish()

invoker := mock.NewMockInvoker(ctrl)
clusterInvoker := registerAvailable(t, invoker)
clusterInvoker := registerAvailable(invoker)

invoker.EXPECT().IsAvailable().Return(false)

Expand Down
1 change: 0 additions & 1 deletion cluster/cluster_impl/base_cluster_invoker.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func (invoker *baseClusterInvoker) checkWhetherDestroyed() error {
}

func (invoker *baseClusterInvoker) doSelect(lb cluster.LoadBalance, invocation protocol.Invocation, invokers []protocol.Invoker, invoked []protocol.Invoker) protocol.Invoker {

var selectedInvoker protocol.Invoker
url := invokers[0].GetUrl()
sticky := url.GetParamBool(constant.STICKY_KEY, false)
Expand Down
4 changes: 2 additions & 2 deletions cluster/cluster_impl/failover_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func normalInvoke(t *testing.T, successCount int, urlParam url.Values, invocatio

invokers := []protocol.Invoker{}
for i := 0; i < 10; i++ {
url, _ := common.NewURL(fmt.Sprintf("dubbo://192.168.1.%v:20000/com.ikurento.user.UserProvider", i), common.WithParams(urlParam))
invokers = append(invokers, NewMockInvoker(url, successCount))
newUrl, _ := common.NewURL(fmt.Sprintf("dubbo://192.168.1.%v:20000/com.ikurento.user.UserProvider", i), common.WithParams(urlParam))
invokers = append(invokers, NewMockInvoker(newUrl, successCount))
}

staticDir := directory.NewStaticDirectory(invokers)
Expand Down
16 changes: 1 addition & 15 deletions cluster/directory/base_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
)

import (
"github.com/dubbogo/gost/container/set"
"go.uber.org/atomic"
)

Expand All @@ -35,8 +34,6 @@ import (
"github.com/apache/dubbo-go/common/logger"
)

var routerURLSet = gxset.NewSet()

// BaseDirectory Abstract implementation of Directory: Invoker list returned from this Directory's list method have been filtered by Routers
type BaseDirectory struct {
url *common.URL
Expand Down Expand Up @@ -92,7 +89,7 @@ func (dir *BaseDirectory) SetRouters(urls []*common.URL) {
factory := extension.GetRouterFactory(url.Protocol)
r, err := factory.NewRouter(url)
if err != nil {
logger.Errorf("Create router fail. router key: %s, error: %v", routerKey, url.Service(), err)
logger.Errorf("Create router fail. router key: %s, url:%s, error: %+v", routerKey, url.Service(), err)
return
}
routers = append(routers, r)
Expand Down Expand Up @@ -120,14 +117,3 @@ func (dir *BaseDirectory) Destroy(doDestroy func()) {
func (dir *BaseDirectory) IsAvailable() bool {
return !dir.destroyed.Load()
}

// GetRouterURLSet Return router URL
func GetRouterURLSet() *gxset.HashSet {
return routerURLSet
}

// AddRouterURLSet Add router URL
// Router URL will init in config/config_loader.go
func AddRouterURLSet(url *common.URL) {
routerURLSet.Add(url)
}
5 changes: 2 additions & 3 deletions cluster/directory/base_directory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package directory

import (
"encoding/base64"
"fmt"
"testing"
)

Expand All @@ -35,7 +34,7 @@ import (
)

func TestNewBaseDirectory(t *testing.T) {
url, _ := common.NewURL(fmt.Sprintf("dubbo://192.168.1.1:20000/com.ikurento.user.UserProvider"))
url, _ := common.NewURL("dubbo://192.168.1.1:20000/com.ikurento.user.UserProvider")
directory := NewBaseDirectory(&url)

assert.NotNil(t, directory)
Expand All @@ -46,7 +45,7 @@ func TestNewBaseDirectory(t *testing.T) {
}

func TestBuildRouterChain(t *testing.T) {
url, _ := common.NewURL(fmt.Sprintf("dubbo://192.168.1.1:20000/com.ikurento.user.UserProvider"))
url, _ := common.NewURL("dubbo://192.168.1.1:20000/com.ikurento.user.UserProvider")
directory := NewBaseDirectory(&url)

assert.NotNil(t, directory)
Expand Down
2 changes: 1 addition & 1 deletion cluster/directory/static_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (dir *staticDirectory) IsAvailable() bool {
// List List invokers
func (dir *staticDirectory) List(invocation protocol.Invocation) []protocol.Invoker {
l := len(dir.invokers)
invokers := make([]protocol.Invoker, l, l)
invokers := make([]protocol.Invoker, l)
copy(invokers, dir.invokers)
routerChain := dir.RouterChain()

Expand Down
33 changes: 10 additions & 23 deletions cluster/loadbalance/consistent_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import (
"strconv"
"strings"
)

import (
gxsort "github.com/dubbogo/gost/sort"
)
import (
"github.com/apache/dubbo-go/cluster"
"github.com/apache/dubbo-go/common/constant"
Expand All @@ -40,7 +42,7 @@ const (
ConsistentHash = "consistenthash"
// HashNodes ...
HashNodes = "hash.nodes"
// HashArguments ...
// HashArguments key of hash arguments in url
HashArguments = "hash.arguments"
)

Expand All @@ -53,16 +55,16 @@ func init() {
extension.SetLoadbalance(ConsistentHash, NewConsistentHashLoadBalance)
}

// ConsistentHashLoadBalance ...
// ConsistentHashLoadBalance implementation of load balancing: using consistent hashing
type ConsistentHashLoadBalance struct {
}

// NewConsistentHashLoadBalance ...
// NewConsistentHashLoadBalance creates NewConsistentHashLoadBalance
func NewConsistentHashLoadBalance() cluster.LoadBalance {
return &ConsistentHashLoadBalance{}
}

// Select ...
// Select gets invoker based on load balancing strategy
func (lb *ConsistentHashLoadBalance) Select(invokers []protocol.Invoker, invocation protocol.Invocation) protocol.Invoker {
methodName := invocation.MethodName()
key := invokers[0].GetUrl().ServiceKey() + "." + methodName
Expand All @@ -85,27 +87,12 @@ func (lb *ConsistentHashLoadBalance) Select(invokers []protocol.Invoker, invocat
return selector.Select(invocation)
}

// Uint32Slice ...
type Uint32Slice []uint32

func (s Uint32Slice) Len() int {
return len(s)
}

func (s Uint32Slice) Less(i, j int) bool {
return s[i] < s[j]
}

func (s Uint32Slice) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}

// ConsistentHashSelector ...
// ConsistentHashSelector implementation of Selector:get invoker based on load balancing strategy
type ConsistentHashSelector struct {
hashCode uint32
replicaNum int
virtualInvokers map[uint32]protocol.Invoker
keys Uint32Slice
keys gxsort.Uint32Slice
argumentIndex []int
}

Expand Down Expand Up @@ -141,7 +128,7 @@ func newConsistentHashSelector(invokers []protocol.Invoker, methodName string,
return selector
}

// Select ...
// Select gets invoker based on load balancing strategy
func (c *ConsistentHashSelector) Select(invocation protocol.Invocation) protocol.Invoker {
key := c.toKey(invocation.Arguments())
digest := md5.Sum([]byte(key))
Expand Down
21 changes: 11 additions & 10 deletions common/config/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ var (
once sync.Once
)

// GetEnvInstance ...
// GetEnvInstance gets env instance by singleton
func GetEnvInstance() *Environment {
once.Do(func() {
instance = &Environment{configCenterFirst: true}
})
return instance
}

// NewEnvInstance ...
// NewEnvInstance creates Environment instance
func NewEnvInstance() {
instance = &Environment{configCenterFirst: true}
}
Expand All @@ -67,21 +67,22 @@ func NewEnvInstance() {
// return env.configCenterFirst
//}

// UpdateExternalConfigMap ...
// UpdateExternalConfigMap updates env externalConfigMap field
func (env *Environment) UpdateExternalConfigMap(externalMap map[string]string) {
for k, v := range externalMap {
env.externalConfigMap.Store(k, v)
}
}

// UpdateAppExternalConfigMap ...
// UpdateAppExternalConfigMap updates env appExternalConfigMap field
func (env *Environment) UpdateAppExternalConfigMap(externalMap map[string]string) {
for k, v := range externalMap {
env.appExternalConfigMap.Store(k, v)
}
}

// Configuration ...
// Configuration puts externalConfigMap and appExternalConfigMap into list
// List represents a doubly linked list.
func (env *Environment) Configuration() *list.List {
cfgList := list.New()
// The sequence would be: SystemConfiguration -> ExternalConfiguration -> AppExternalConfiguration -> AbstractConfig -> PropertiesConfiguration
Expand All @@ -90,17 +91,17 @@ func (env *Environment) Configuration() *list.List {
return cfgList
}

// SetDynamicConfiguration ...
// SetDynamicConfiguration sets value for dynamicConfiguration
func (env *Environment) SetDynamicConfiguration(dc config_center.DynamicConfiguration) {
env.dynamicConfiguration = dc
}

// GetDynamicConfiguration ...
// GetDynamicConfiguration gets dynamicConfiguration
func (env *Environment) GetDynamicConfiguration() config_center.DynamicConfiguration {
return env.dynamicConfiguration
}

// InmemoryConfiguration ...
// InmemoryConfiguration stores config in memory
type InmemoryConfiguration struct {
store *sync.Map
}
Expand All @@ -109,7 +110,7 @@ func newInmemoryConfiguration(p *sync.Map) *InmemoryConfiguration {
return &InmemoryConfiguration{store: p}
}

// GetProperty ...
// GetProperty gets value from InmemoryConfiguration instance by @key
func (conf *InmemoryConfiguration) GetProperty(key string) (bool, string) {
if conf.store == nil {
return false, ""
Expand All @@ -123,7 +124,7 @@ func (conf *InmemoryConfiguration) GetProperty(key string) (bool, string) {
return false, ""
}

// GetSubProperty ...
// GetSubProperty gets sub property from InmemoryConfiguration instance by @subkey
func (conf *InmemoryConfiguration) GetSubProperty(subKey string) map[string]struct{} {
if conf.store == nil {
return nil
Expand Down
5 changes: 5 additions & 0 deletions common/constant/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ const (

const (
SIMPLE_METADATA_SERVICE_NAME = "MetadataService"
DEFAULT_REVIESION = "N/A"
)

const (
SERVICE_DISCOVERY_DEFAULT_GROUP = "DEFAULT_GROUP"
)
21 changes: 19 additions & 2 deletions common/constant/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
)

const (
PORT_KEY = "port"
GROUP_KEY = "group"
VERSION_KEY = "version"
INTERFACE_KEY = "interface"
Expand Down Expand Up @@ -79,6 +80,7 @@ const (
EXECUTE_REJECTED_EXECUTION_HANDLER_KEY = "execute.limit.rejected.handler"
PROVIDER_SHUTDOWN_FILTER = "pshutdown"
CONSUMER_SHUTDOWN_FILTER = "cshutdown"
PID_KEY = "pid"
SYNC_REPORT_KEY = "sync.report"
RETRY_PERIOD_KEY = "retry.period"
RETRY_TIMES_KEY = "retry.times"
Expand Down Expand Up @@ -186,6 +188,9 @@ const (
// ForceUseTag is the tag in attachment
ForceUseTag = "dubbo.force.tag"
Tagkey = "dubbo.tag"

// Attachment key in context in invoker
AttachmentKey = "attachment"
)

const (
Expand Down Expand Up @@ -257,7 +262,19 @@ const (
)

// service discovery

const (
NACOS_GROUP = "nacos.group"
SUBSCRIBED_SERVICE_NAMES_KEY = "subscribed-services"
PROVIDER_BY = "provided-by"
EXPORTED_SERVICES_REVISION_PROPERTY_NAME = "dubbo.exported-services.revision"
SUBSCRIBED_SERVICES_REVISION_PROPERTY_NAME = "dubbo.subscribed-services.revision"
SERVICE_INSTANCE_SELECTOR = "service-instance-selector"
METADATA_STORAGE_TYPE_PROPERTY_NAME = "dubbo.metadata.storage-type"
DEFAULT_METADATA_STORAGE_TYPE = "local"
SERVICE_INSTANCE_ENDPOINTS = "dubbo.endpoints"
METADATA_SERVICE_PREFIX = "dubbo.metadata-service."
METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME = METADATA_SERVICE_PREFIX + "url-params"
METADATA_SERVICE_URLS_PROPERTY_NAME = METADATA_SERVICE_PREFIX + "urls"

// SERVICE_DISCOVERY_KEY indicate which service discovery instance will be used
SERVICE_DISCOVERY_KEY = "service_discovery"
)