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

Ftr: registry ip:port set from enviroment variable #1036

Merged
merged 8 commits into from
Feb 23, 2021
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ make test
<a href="http://alexstocks.github.io/html/dubbogo.html">
<img src="./doc/pic/misc/dubbogo-dingding.png" height="80" width="80"></a>

如果想加入到社区微信群,可以先添加社区负责人 于雨 的微信 AlexanderStocks 。添加微信之前,请先给 dubbo-go 点 star 作为对项目的支持,添加好友时请报上 github ID 以进行验证。
如果想加入到社区微信群,可以先添加社区负责人 于雨 的微信 AlexanderStocks 。
AlexStocks marked this conversation as resolved.
Show resolved Hide resolved

作为一个维护已经帮助构建了经受多家大型微服务系统的社区,我们足以为现有的成绩感到自豪。社区欢迎能提出建设性意见者,只知索取者和喷子请绕行
作为一个维护已经帮助构建了经受多家大型微服务系统的社区,我们足以为现有的成绩感到自豪。社区欢迎能提出建设性意见者。

## 性能测试 ##

Expand Down
7 changes: 7 additions & 0 deletions registry/base_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ func (r *BaseRegistry) Register(conf *common.URL) error {
ok bool
err error
)
// if developer define registry port and ip, use it first.
if ipToRegistry := os.Getenv("DUBBO_IP_TO_REGISTRY"); ipToRegistry != "" {
gaoxinge marked this conversation as resolved.
Show resolved Hide resolved
conf.Ip = ipToRegistry
}
if portToRegistry := os.Getenv("DUBBO_PORT_TO_REGISTRY"); portToRegistry != "" {
conf.Port = portToRegistry
}
role, _ := strconv.Atoi(r.URL.GetParam(constant.ROLE_KEY, ""))
// Check if the service has been registered
r.cltLock.Lock()
Expand Down