This is an automated email from the ASF dual-hosted git repository. mark4z pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu.git
The following commit(s) were added to refs/heads/develop by this push: new a679ff2a support custom dubbo invoke retry times (#625) a679ff2a is described below commit a679ff2a0f2390849fa2abe3b54c385f2c99ac79 Author: Mark4z <36187602+mar...@users.noreply.github.com> AuthorDate: Thu Apr 25 14:59:53 2024 +0800 support custom dubbo invoke retry times (#625) * support custom dubbo invoke retries times * Update config.go --- pkg/client/dubbo/config.go | 4 +++- pkg/client/dubbo/dubbo.go | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pkg/client/dubbo/config.go b/pkg/client/dubbo/config.go index c4055913..f4e56a97 100644 --- a/pkg/client/dubbo/config.go +++ b/pkg/client/dubbo/config.go @@ -33,6 +33,8 @@ type DubboProxyConfig struct { AutoResolve bool `yaml:"auto_resolve" json:"auto_resolve,omitempty"` // Protoset path to load protoset files Protoset []string `yaml:"protoset" json:"protoset,omitempty"` - // Load + // Load balance LoadBalance string `yaml:"load_balance" json:"load_balance,omitempty"` + // Retries number of retries + Retries string `yaml:"retries" json:"retries,omitempty"` } diff --git a/pkg/client/dubbo/dubbo.go b/pkg/client/dubbo/dubbo.go index ad323caf..ca3e61c3 100644 --- a/pkg/client/dubbo/dubbo.go +++ b/pkg/client/dubbo/dubbo.go @@ -319,12 +319,15 @@ func (dc *Client) create(key string, irequest fc.IntegrationRequest) *generic.Ge Version: irequest.DubboBackendConfig.Version, Group: irequest.Group, Loadbalance: dc.dubboProxyConfig.LoadBalance, + Retries: dc.dubboProxyConfig.Retries, } - if len(irequest.DubboBackendConfig.Retries) == 0 { - refConf.Retries = "3" - } else { - refConf.Retries = irequest.DubboBackendConfig.Retries + if refConf.Retries == "" { + if len(irequest.DubboBackendConfig.Retries) == 0 { + refConf.Retries = "3" + } else { + refConf.Retries = irequest.DubboBackendConfig.Retries + } } if dc.dubboProxyConfig.Timeout != nil {