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

Imp: remote service discovery #1161

Merged
merged 3,846 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
3846 commits
Select commit Hold shift + click to select a range
89566dd
modify func pathToKey
yakecanlee Mar 7, 2021
70e86f7
Fix
LaurenceLiZhixin Mar 8, 2021
7553e83
fix: destroy invoker smoothly
LaurenceLiZhixin Mar 8, 2021
e416b3a
move etcd client to gost
wenxuwan Mar 8, 2021
e6583c9
fix lint error
wenxuwan Mar 8, 2021
6dff4c6
fix lint error
wenxuwan Mar 8, 2021
249d814
move options to gost
wenxuwan Mar 9, 2021
8aeadf6
fix lint error
wenxuwan Mar 9, 2021
d6f0f24
mod changed the way of setting default parameters
cjphaha Mar 9, 2021
3cd960b
update gost version
wenxuwan Mar 10, 2021
502b30b
go mod tidy
wenxuwan Mar 10, 2021
2e08039
feat: add pass through proxy factory
LaurenceLiZhixin Mar 10, 2021
f54ea24
Merge remote-tracking branch 'upstream/3.0' into 3.0
LaurenceLiZhixin Mar 10, 2021
e41d6fb
Merge branch '3.0' into Ftr/proxy-service
LaurenceLiZhixin Mar 10, 2021
feff21f
fix: add test
LaurenceLiZhixin Mar 10, 2021
b30e46b
fix: fmt import block
LaurenceLiZhixin Mar 10, 2021
6f22087
fix
LaurenceLiZhixin Mar 10, 2021
3bf0f46
Fix: try ci
LaurenceLiZhixin Mar 10, 2021
f2447a7
add unit test for func pathToKey
yakecanlee Mar 10, 2021
8b171be
fix linter error
yakecanlee Mar 10, 2021
274718b
Merge pull request #1066 from yakecanlee/feature/fix-zk-configurators
AlexStocks Mar 10, 2021
d8b440e
merge 1.5
AlexStocks Feb 28, 2021
cfd384c
add rpcinvocation_test.go
Mar 11, 2021
57b92f9
fix: change triple struct
LaurenceLiZhixin Mar 14, 2021
1f7d4e4
fix: fix cr
LaurenceLiZhixin Mar 14, 2021
e7e18e1
fix: add liscense
LaurenceLiZhixin Mar 14, 2021
4ae4b5c
fix crd name
LaurenceLiZhixin Mar 14, 2021
0b939ea
fix: merge conflict, delete router
LaurenceLiZhixin Mar 14, 2021
a231789
upgrade hession version
wenxuwan Mar 15, 2021
99d3d4f
Merge pull request #1078 from tweitjss/master
AlexStocks Mar 15, 2021
4f60f69
Merge pull request #1030 from luckyxiaoqiang/feature/improve_config_c…
AlexStocks Mar 15, 2021
ffd09c9
fix
LaurenceLiZhixin Mar 15, 2021
0b3c7bc
fix: add two feature to readme
LaurenceLiZhixin Mar 15, 2021
9234948
Fix: add file system
LaurenceLiZhixin Mar 15, 2021
68a9c62
Merge pull request #1085 from LaurenceLiZhixin/fix/readme
AlexStocks Mar 15, 2021
76c52b6
change go version
wenxuwan Mar 15, 2021
6f74ff9
Merge pull request #1010 from wenxuwan/fix_zk_too_many_tcp_conn
AlexStocks Mar 15, 2021
6175e24
change go version
wenxuwan Mar 15, 2021
699e0e2
bugfix: Give it an initial value when attachments is nil
Mar 16, 2021
45ca4f3
dubbo-go 拆包bug fix
Mar 17, 2021
6108ed0
Merge branch 'master' of https://github.com/xiejiajun/dubbo-go
Mar 17, 2021
a078cd9
upgrade hession version
wenxuwan Mar 17, 2021
15db1fc
remove hessian2 version history in go.sum
wenxuwan Mar 17, 2021
587753b
Merge pull request #1088 from wenxuwan/fix_zk_too_many_tcp_conn
cityiron Mar 17, 2021
53799e8
Fix: change triple api and add test file
LaurenceLiZhixin Mar 18, 2021
bbc9af2
fix: fix ci
LaurenceLiZhixin Mar 18, 2021
c1f9073
fix: change ctx key type
LaurenceLiZhixin Mar 18, 2021
98100e8
fix: fix linter
LaurenceLiZhixin Mar 18, 2021
c5e638d
fix: fix linter
LaurenceLiZhixin Mar 18, 2021
1d0f9fc
fix: add liscense
LaurenceLiZhixin Mar 18, 2021
95e0460
Fix: fix test
LaurenceLiZhixin Mar 18, 2021
90e3a32
fix: change port
LaurenceLiZhixin Mar 18, 2021
b37dd9f
fix: change port
LaurenceLiZhixin Mar 18, 2021
57f7b4e
bug fix: getty RpcServerPackageHandler decode tcp pkg failed because …
Mar 18, 2021
25cdffb
fix: change port
LaurenceLiZhixin Mar 18, 2021
31d9cd2
fix: change lock range
LaurenceLiZhixin Mar 18, 2021
160b834
keep error caller stack
Mar 18, 2021
9478b1c
fix: fix refer
LaurenceLiZhixin Mar 18, 2021
2fee909
fix: delete unused router
LaurenceLiZhixin Mar 18, 2021
71490a2
fix: linter
LaurenceLiZhixin Mar 18, 2021
1615aef
fix: fix test
LaurenceLiZhixin Mar 18, 2021
ff2172c
fix: fix test
LaurenceLiZhixin Mar 18, 2021
f7d6e2e
fix: add liscense
LaurenceLiZhixin Mar 18, 2021
80a24cb
code improve: use the `errors.Is()` to determine the type of err
Mar 18, 2021
40a9f7c
getty RpcServerPackageHandler decode incomplete tcp package unit test
Mar 18, 2021
8e18ffb
getty RpcServerPackageHandler decode incomplete tcp package unit test
Mar 18, 2021
da44eee
RpcClientPackageHandler error compare code improve
Mar 18, 2021
3afacb4
ut ci failed fix
Mar 18, 2021
0583f46
readwriter_test ci failed fix
Mar 18, 2021
51f6d0f
readwriter_test import code improve
Mar 19, 2021
c6a448b
code improve
Mar 19, 2021
06a2a7b
fix: fix test
LaurenceLiZhixin Mar 19, 2021
01b314d
fix: fix test
LaurenceLiZhixin Mar 19, 2021
eb43779
fix: fix test
LaurenceLiZhixin Mar 19, 2021
6355bf5
fix: fix test
LaurenceLiZhixin Mar 19, 2021
ae5743a
Merge pull request #1090 from xiejiajun/issue-1089
AlexStocks Mar 19, 2021
cbbe332
fix: fix test
LaurenceLiZhixin Mar 19, 2021
e4f7549
Fix: delete debug
LaurenceLiZhixin Mar 19, 2021
5a359fa
fix: restart ci
LaurenceLiZhixin Mar 19, 2021
4152114
fix: fix test
LaurenceLiZhixin Mar 19, 2021
2cc9f13
Merge pull request #3 from apache/1.5
kzhan Mar 21, 2021
4640167
Merge pull request #1073 from cjphaha/develop
AlexStocks Mar 21, 2021
fb2fb83
fix cr
LaurenceLiZhixin Mar 21, 2021
da6f6f6
fix: restart ci
LaurenceLiZhixin Mar 21, 2021
a0276f8
fix: grpc connectTimeout
Mar 22, 2021
eb7f50a
up 1.5.6 version
Mar 22, 2021
0a6fe2d
Merge pull request #1097 from cityiron/feature/update1.5.6
AlexStocks Mar 23, 2021
e3bcdc9
add config_loader_options
qq5272689 Mar 23, 2021
1d13e1d
add config_loader_options
qq5272689 Mar 23, 2021
09fa89a
add samples
zouyx Mar 25, 2021
20e2f41
add samples
zouyx Mar 25, 2021
db48b39
fix: add test case
LaurenceLiZhixin Mar 25, 2021
8e75f9f
fix: add liscence
LaurenceLiZhixin Mar 25, 2021
1798057
fix: restart ci
LaurenceLiZhixin Mar 25, 2021
5614e8d
remove useless field
zouyx Mar 26, 2021
a7a2c30
fix: add serializer option
LaurenceLiZhixin Mar 26, 2021
9b7c910
fix: add test
LaurenceLiZhixin Mar 26, 2021
df7ced8
fix: add liscence
LaurenceLiZhixin Mar 26, 2021
fb540d9
fix: change triple
LaurenceLiZhixin Mar 26, 2021
11ef2e8
up:更新go.sum
zhaoyunxing92 Mar 27, 2021
0f6b82c
Merge pull request #1106 from zhaoyunxing92/fix-nacos-1.5
AlexStocks Mar 27, 2021
d47777f
Merge pull request #1 from kzhan/feature/grcp_connect_timeout
ztelur Mar 27, 2021
a773c5f
Merge pull request #1087 from rockXiaofeng/Ftr/nilAttachments
AlexStocks Mar 27, 2021
98a8afa
grpc-register&openServer code style
ztelur Mar 27, 2021
31724cf
import sort
ztelur Mar 27, 2021
e271c45
console.nacos.io has updated to nacos 2.0 and serviceName has changed…
zouyx Mar 27, 2021
5b981f6
update submodule config
zouyx Mar 27, 2021
bcb4a62
remove time.format and replace local relative path dependency
ztelur Mar 27, 2021
9610074
Merge pull request #1102 from zouyx/addSamples
AlexStocks Mar 28, 2021
eba1c2c
add dependency and trigger ci
ztelur Mar 28, 2021
277d1c1
trigger ci again
ztelur Mar 28, 2021
7984ce3
fix:map iteration order
zhaoyunxing92 Mar 28, 2021
c7690fe
fix grpc ut failure
ztelur Mar 28, 2021
ad3a6c4
Merge pull request #1109 from zhaoyunxing92/fix-map
AlexStocks Mar 28, 2021
6762cd2
remove log
ztelur Mar 28, 2021
bc32e98
trigger ci
ztelur Mar 28, 2021
cde0d80
Merge pull request #2 from apache/1.5
ztelur Mar 28, 2021
05e103d
add lock when destroy
ztelur Mar 28, 2021
9ce7b15
Merge pull request #1112 from ztelur/feature-grpc-register
AlexStocks Mar 28, 2021
cb2a10c
up 1.5.6 changelist
Mar 28, 2021
c2d86a4
Merge pull request #1113 from cityiron/feature/up-changelist
cityiron Mar 28, 2021
3cf3f1b
upstream nacos version
xiaoliu10 Mar 29, 2021
50042b9
Merge pull request #1116 from xiaoliu10/upgrade_nacos_version
AlexStocks Mar 29, 2021
da1c4d6
fix bad type check logic
wenxuwan Mar 31, 2021
7ff77bc
Merge remote-tracking branch 'upstream/1.5' into merge1.5to3.0
wenxuwan Mar 31, 2021
33e1908
fix provider init error
wenxuwan Mar 31, 2021
d7036a5
Merge pull request #1120 from wenxuwan/merge1.5to3.0
AlexStocks Mar 31, 2021
e0c3fdb
Merge remote-tracking branch 'upstream/3.0' into fix_type_error
wenxuwan Mar 31, 2021
73bd3c1
feat: format use gofumpt
georgehao Mar 31, 2021
759bea2
Merge pull request #1121 from georgehao/3.0
AlexStocks Mar 31, 2021
78bea16
Merge pull request #1118 from wenxuwan/fix_type_error
AlexStocks Mar 31, 2021
a28385c
Merge remote-tracking branch 'upstream/3.0' into move_etcd
wenxuwan Apr 1, 2021
7a5f629
Bump github.com/magiconair/properties from 1.8.4 to 1.8.5
dependabot[bot] Apr 1, 2021
b1839a1
move 3rd import block
qq5272689 Apr 1, 2021
856e5ab
fix panic: sync: negative WaitGroup counter
Apr 2, 2021
3452103
fixï: add hessian support
LaurenceLiZhixin Apr 2, 2021
d785615
feat: add triple hessian support
LaurenceLiZhixin Apr 2, 2021
d495d89
fix: fix conflict
LaurenceLiZhixin Apr 2, 2021
ddf86b4
fix: change go mod
LaurenceLiZhixin Apr 2, 2021
6a76922
fix: change go mod
LaurenceLiZhixin Apr 2, 2021
911fd2d
fix: fix conflict
LaurenceLiZhixin Apr 2, 2021
69136b3
fix: change consul
LaurenceLiZhixin Apr 2, 2021
e4fefc7
fix: rerun ci
LaurenceLiZhixin Apr 2, 2021
c7bf9b5
change go.mod
wenxuwan Apr 2, 2021
00ae936
fix: triple finish
LaurenceLiZhixin Apr 3, 2021
32981f0
fix: add router weight
LaurenceLiZhixin Apr 3, 2021
a3db267
fix
LaurenceLiZhixin Apr 3, 2021
b182216
fix
LaurenceLiZhixin Apr 3, 2021
a6ee0ce
fix ci error
wenxuwan Apr 3, 2021
e8bad05
fix: fix import block
LaurenceLiZhixin Apr 3, 2021
43ce557
fix: split router from dubbogo
LaurenceLiZhixin Apr 3, 2021
8b5ac5d
fix: restart ci
LaurenceLiZhixin Apr 3, 2021
5a5103b
fix: restart ci
LaurenceLiZhixin Apr 3, 2021
36fc244
fix: restart ci
LaurenceLiZhixin Apr 3, 2021
409c745
Merge pull request #1115 from apache/dependabot/go_modules/develop/gi…
AlexStocks Apr 3, 2021
9202654
fix: update golang ci
LaurenceLiZhixin Apr 3, 2021
608ae85
nacos for service_discovery support namespace
Malvin666 Apr 2, 2021
5f4a51d
Merge branch '3.0' of https://github.com/apache/dubbo-go into 3.0
AlexStocks Apr 3, 2021
6ff62af
fix: fix conflict
LaurenceLiZhixin Apr 3, 2021
9635a6a
Merge pull request #1129 from jack15083/1.5
AlexStocks Apr 3, 2021
7d01274
fix: fix merge conflict
LaurenceLiZhixin Apr 3, 2021
72abb01
fix: fix zk import
LaurenceLiZhixin Apr 3, 2021
9b0e5ea
fix: change ci lint vesion
LaurenceLiZhixin Apr 3, 2021
9119d58
Merge pull request #1076 from wenxuwan/move_etcd_to_gost
AlexStocks Apr 3, 2021
2d54f5c
fix: conflict
LaurenceLiZhixin Apr 3, 2021
ca7f3a8
Merge pull request #1071 from LaurenceLiZhixin/Ftr/triple
AlexStocks Apr 3, 2021
e3b2cf2
Merge branch '3.0' into Ftr/proxy-service
LaurenceLiZhixin Apr 3, 2021
71a50f9
fix: fix conflict
LaurenceLiZhixin Apr 3, 2021
6879502
fix: conflict
LaurenceLiZhixin Apr 3, 2021
926cfe3
fix: change import block
LaurenceLiZhixin Apr 3, 2021
82d26db
fix: change passthrough factory param
LaurenceLiZhixin Apr 3, 2021
77f9cea
fix: change passthrough factory param
LaurenceLiZhixin Apr 3, 2021
27ff1f7
fix: fix conflict
LaurenceLiZhixin Apr 3, 2021
f39cc52
Merge pull request #1081 from LaurenceLiZhixin/Ftr/proxy-service
AlexStocks Apr 3, 2021
aefa0e9
get from upstream
LaurenceLiZhixin Apr 3, 2021
a668c79
fix: conflict
LaurenceLiZhixin Apr 3, 2021
685c97c
Merge branch '3.0' into Ftr/uniform-router
LaurenceLiZhixin Apr 3, 2021
ca88c8d
fix: fix comment
LaurenceLiZhixin Apr 3, 2021
a1e75f7
Merge branch 'Ftr/uniform-router' of github.com:LaurenceLiZhixin/dubb…
LaurenceLiZhixin Apr 3, 2021
15fbcfc
fix: fix go mod
LaurenceLiZhixin Apr 3, 2021
d1801c1
Merge pull request #1083 from LaurenceLiZhixin/Ftr/uniform-router
AlexStocks Apr 3, 2021
6610eae
Fix: Id -> ID
AlexStocks Apr 4, 2021
e53721e
Merge branch '3.0' of https://github.com/apache/dubbo-go into 3.0
AlexStocks Apr 4, 2021
b26354d
3.0 service discovery optimize
Patrick0308 Apr 4, 2021
1370cb8
use once
Patrick0308 Apr 4, 2021
61af2d0
optimize
Patrick0308 Apr 4, 2021
2418f79
remove some thing
Patrick0308 Apr 4, 2021
5c0f7ba
Merge branch '3.0' into 3.0
LaurenceLiZhixin Apr 5, 2021
abbd985
Merge pull request #1099 from qq5272689/3.0
AlexStocks Apr 5, 2021
be250df
fix: plugin
LaurenceLiZhixin Apr 5, 2021
a1550a8
fix: refresh tag
LaurenceLiZhixin Apr 5, 2021
19c3cc3
Merge pull request #1132 from LaurenceLiZhixin/Fix/3.0-plugin
AlexStocks Apr 5, 2021
9651ec2
fix: fix lint bug
LaurenceLiZhixin Apr 5, 2021
d2c4dff
fix: change GetID function
LaurenceLiZhixin Apr 5, 2021
eeaca76
Merge pull request #1133 from LaurenceLiZhixin/Fix/lintbug
AlexStocks Apr 5, 2021
99eff44
inmemory metadata
Patrick0308 Apr 5, 2021
3b4022b
inmemory metadata
Patrick0308 Apr 5, 2021
771dea8
Add: place v1.5.6 into readme
AlexStocks Apr 9, 2021
6463de0
Merge branch '3.0' of https://github.com/apache/dubbo-go into 3.0
AlexStocks Apr 9, 2021
101d54b
Merge remote-tracking branch 'upstream/3.0' into feature/3.0-service-…
Patrick0308 Apr 12, 2021
896a687
fix
Patrick0308 Apr 12, 2021
801415e
Merge branch 'develop' of https://github.com/apache/dubbo-go into dev…
AlexStocks Apr 14, 2021
00dbac5
Merge branch '3.0' into develop
AlexStocks Apr 14, 2021
e2022b0
Merge branch '3.0' into develop
AlexStocks Apr 16, 2021
3d172bf
âfeat: support v3 remote zk metadata report
LaurenceLiZhixin Apr 16, 2021
b63df6c
fix
Patrick0308 Apr 17, 2021
54136c7
fix generateMetadataURL
Patrick0308 Apr 17, 2021
e12e499
register metadata info in hessian
Patrick0308 Apr 17, 2021
3734790
fix getMetadataInfo invoke arguments
Patrick0308 Apr 17, 2021
76a2082
add interface_key param
Patrick0308 Apr 17, 2021
e09ecf7
getMetadataInfo add error return
Patrick0308 Apr 17, 2021
964da2c
getMetadataInfo add error return
Patrick0308 Apr 17, 2021
aba4167
register service info in hessian
Patrick0308 Apr 17, 2021
e3b111c
add comment and remove some unuseless
Patrick0308 Apr 17, 2021
9a3d220
optimize extension local metadataService
Patrick0308 Apr 17, 2021
b28f571
pub metadata constantly
Patrick0308 Apr 17, 2021
0341626
add comment
Patrick0308 Apr 17, 2021
12375e7
Merge branch 'v3metadata-report' into feature/3.0-service-discovery
Patrick0308 Apr 17, 2021
4f7ecdf
Merge remote-tracking branch 'upstream/develop' into feature/3.0-serv…
Patrick0308 Apr 17, 2021
613c3f6
Merge remote-tracking branch 'upstream/3.0' into feature/3.0-service-…
Patrick0308 Apr 17, 2021
9f3bfd0
remove duplicate code, add comment and fix
Patrick0308 Apr 18, 2021
8c57438
optimize and fix import
Patrick0308 Apr 18, 2021
cc72394
add comment and split import
Patrick0308 Apr 18, 2021
a1241e4
fix
Patrick0308 Apr 18, 2021
9387e76
fix
Patrick0308 Apr 18, 2021
e0a7396
modify release_note.md
Patrick0308 Apr 18, 2021
873627d
add TODO
Patrick0308 Apr 18, 2021
ec5851e
fix problems
Patrick0308 Apr 18, 2021
558f074
fix import
Patrick0308 Apr 18, 2021
8d0b841
fix import
Patrick0308 Apr 18, 2021
48b1e4b
fix import and add comment
Patrick0308 Apr 18, 2021
84863bf
fix import and add comment
Patrick0308 Apr 18, 2021
c4caf90
fix mod and fix import
Patrick0308 Apr 18, 2021
393c9ad
fix service instances changed listener
Patrick0308 Apr 18, 2021
ec2809c
fix zookeeper service_discovery.go
Patrick0308 Apr 18, 2021
c5b9675
optimize creator
Patrick0308 Apr 18, 2021
ccf888b
optimize and modify comment
Patrick0308 Apr 18, 2021
d4cfabf
fix import and modify comment
Patrick0308 Apr 18, 2021
8899533
fix
Patrick0308 Apr 18, 2021
54fe4f5
fix import
Patrick0308 Apr 18, 2021
571ab31
fix
Patrick0308 Apr 18, 2021
520f55c
exprot struct field
Patrick0308 Apr 18, 2021
f4e4e69
add error log
Patrick0308 Apr 18, 2021
631e1f3
fix
Patrick0308 Apr 18, 2021
a1e8e53
add BaseApplicationMetadataIdentifier
Patrick0308 Apr 19, 2021
fc8a61d
fix
Patrick0308 Apr 19, 2021
19968a0
fix
Patrick0308 Apr 19, 2021
a4edfbf
fix json classType
Patrick0308 Apr 19, 2021
8477a9b
fix payload json classType
Patrick0308 Apr 19, 2021
4acc46f
fix
Patrick0308 Apr 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .asf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
notifications:
commits: commits@dubbo.apache.org
issues: notifications@dubbo.apache.org
pullrequests: notifications@dubbo.apache.org
jira_options: link label link label
notifications:
commits: commits@dubbo.apache.org
issues: notifications@dubbo.apache.org
pullrequests: notifications@dubbo.apache.org
jira_options: link label link label
38 changes: 19 additions & 19 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
name: Bug Report
about: Report a bug
labels: kind/bug

---

<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!

-->


**What happened**:

**What you expected to happen**:

**How to reproduce it (as minimally and precisely as possible)**:

**Anything else we need to know?**:
---
name: Bug Report
about: Report a bug
labels: kind/bug
---
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
-->
**What happened**:
**What you expected to happen**:
**How to reproduce it (as minimally and precisely as possible)**:
**Anything else we need to know?**:
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: Enhancement Request
about: Suggest an enhancement
labels: kind/feature

---
<!-- Please only use this template for submitting enhancement requests -->

**What would you like to be added**:

---
name: Enhancement Request
about: Suggest an enhancement
labels: kind/feature
---
<!-- Please only use this template for submitting enhancement requests -->
**What would you like to be added**:
**Why is this needed**:
3 changes: 2 additions & 1 deletion common/constant/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,12 @@ const (
const (
SUBSCRIBED_SERVICE_NAMES_KEY = "subscribed-services"
PROVIDER_BY = "provided-by"
EXPORTED_SERVICES_REVISION_PROPERTY_NAME = "dubbo.exported-services.revision"
EXPORTED_SERVICES_REVISION_PROPERTY_NAME = "dubbo.metadata.revision"
AlexStocks marked this conversation as resolved.
Show resolved Hide resolved
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"
REMOTE_METADATA_STORAGE_TYPE = "remote"
SERVICE_INSTANCE_ENDPOINTS = "dubbo.endpoints"
METADATA_SERVICE_PREFIX = "dubbo.metadata-service."
METADATA_SERVICE_URL_PARAMS_PROPERTY_NAME = METADATA_SERVICE_PREFIX + "url-params"
Expand Down
33 changes: 33 additions & 0 deletions common/extension/metadata_remote.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package extension

import (
Patrick0308 marked this conversation as resolved.
Show resolved Hide resolved
"fmt"
)

import (
perrors "github.com/pkg/errors"
)

Patrick0308 marked this conversation as resolved.
Show resolved Hide resolved
import (
"github.com/apache/dubbo-go/metadata/service/remote"
)

type remoteMetadataServiceCreator func() (remote.RemoteMetadataService, error)

var (
creator remoteMetadataServiceCreator
)

// SetRemoteMetadataService will store the remote metadata service
func SetRemoteMetadataService(creatorFunc remoteMetadataServiceCreator) {
creator = creatorFunc
}

// GetRemoteMetadataServiceFactory will create a MetadataService instance
func GetRemoteMetadataService() (remote.RemoteMetadataService, error) {
if creator != nil {
return creator()
}
return nil, perrors.New(fmt.Sprintf("could not find the metadata service creator for metadataType: remote, please check whether you have imported relative packages, \n" +
"remote - github.com/apache/dubbo-go/metadata/remote/impl"))
}
43 changes: 15 additions & 28 deletions common/extension/metadata_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,29 @@ import (
)

import (
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/metadata/service"
)

type localMetadataServiceCreator func() (service.MetadataService, error)

var (
// there will be two types: local or remote
Patrick0308 marked this conversation as resolved.
Show resolved Hide resolved
metadataServiceInsMap = make(map[string]func() (service.MetadataService, error), 2)
// remoteMetadataService
remoteMetadataService service.MetadataService
localMetadataServiceInsMap = make(map[string]localMetadataServiceCreator, 2)
)

// SetMetadataService will store the msType => creator pair
func SetMetadataService(msType string, creator func() (service.MetadataService, error)) {
metadataServiceInsMap[msType] = creator
}

// GetMetadataService will create a MetadataService instance
func GetMetadataService(msType string) (service.MetadataService, error) {
if creator, ok := metadataServiceInsMap[msType]; ok {
return creator()
}
return nil, perrors.New(fmt.Sprintf("could not find the metadata service creator for metadataType: %s, please check whether you have imported relative packages, \n"+
"local - github.com/apache/dubbo-go/metadata/service/inmemory, \n"+
"remote - github.com/apache/dubbo-go/metadata/service/remote", msType))
// SetLocalMetadataService will store the msType => creator pair
func SetLocalMetadataService(key string, creator localMetadataServiceCreator) {
localMetadataServiceInsMap[key] = creator
}

// GetRemoteMetadataService will get a RemoteMetadataService instance
func GetRemoteMetadataService() (service.MetadataService, error) {
if remoteMetadataService != nil {
return remoteMetadataService, nil
// GetMetadataService will create a inmemory MetadataService instance
func GetLocalMetadataService(key string) (service.MetadataService, error) {
if key == "" {
key = constant.DEFAULT_KEY
}
if creator, ok := metadataServiceInsMap["remote"]; ok {
var err error
remoteMetadataService, err = creator()
return remoteMetadataService, err
if creator, ok := localMetadataServiceInsMap[key]; ok {
return creator()
}
logger.Warn("could not find the metadata service creator for metadataType: remote")
return nil, perrors.New(fmt.Sprintf("could not find the metadata service creator for metadataType: remote"))
return nil, perrors.New(fmt.Sprintf("could not find the metadata service creator for metadataType: local, please check whether you have imported relative packages, \n" +
"local - github.com/apache/dubbo-go/metadata/service/inmemory, "))
}
7 changes: 5 additions & 2 deletions common/extension/metadata_service_proxy_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
)

import (
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/metadata/service"
)

Expand All @@ -37,10 +38,12 @@ func SetMetadataServiceProxyFactory(name string, creator MetadataServiceProxyFac
// GetMetadataServiceProxyFactory will create an instance.
// it will panic if the factory with name not found
func GetMetadataServiceProxyFactory(name string) service.MetadataServiceProxyFactory {
if name == "" {
name = constant.DEFAULT_KEY
}
if f, ok := metadataServiceProxyFactoryMap[name]; ok {
return f()
}
panic(fmt.Sprintf("could not find the metadata service factory creator for name: %s, please check whether you have imported relative packages, \n"+
"local - github.com/apache/dubbo-go/metadata/service/inmemory, \n"+
"remote - github.com/apache/dubbo-go/metadata/service/remote", name))
"local - github.com/apache/dubbo-go/metadata/service/inmemory, \n", name))
}
Loading