wangxw666 opened a new issue #1237:
URL: https://github.com/apache/dubbo-go/issues/1237
问题:
在dubbo-go demo中
```
func main() {
config.Load()
time.Sleep(3 * time.Second)
gxlog.CInfo("\n\n\nstart to test dubbo")
user := &pkg.User{}
err := userProvider.GetUser(context.TODO(), []interface{}{"A001"}, user)
if err != nil {
gxlog.CError("error: %v\n", err)
os.Exit(1)
return
}
gxlog.CInfo("response result: %v\n", user)
}
```
consumer 端
需要sleep三秒,才能进行消费,原因是要等待RegistryDirectory刷新invoker后才能进行服务调用流程。然而这种情况对于生产级别的应用是不友好的,因为生成的应用都会配置startup
probe进行检测,只有当应用处于就绪态才能对外提供服务,避免报错。(无论是从用户角度还是从应用的sla上)
所以这里应该向dubbo
对齐。(lifecycle)[https://dubbo.apache.org/zh/docs/v3.0/references/lifecycle/brief/]
我提了一个pr [#1235](https://github.com/apache/dubbo-go/pull/1235)
但是依然有几个问题:
1、provider的readliness 可以参考dubbo
2、
consumer的readliness就不好解决了,这里dubbo也没有处理,我想原因是这样的。因为spring这种基于jvm的应用本身init就比较慢,所启动时就能等到RegistryDirectory
refresh之后才启动,但是go 启动的非常快。应该从哪个角度才能确定应用已经readliness了那
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]