Skip to content

Commit

Permalink
support custom dubbo invoke retry times (#625)
Browse files Browse the repository at this point in the history
* support custom dubbo invoke retries times

* Update config.go
  • Loading branch information
mark4z authored Apr 25, 2024
1 parent 9fd3f9f commit a679ff2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion pkg/client/dubbo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
11 changes: 7 additions & 4 deletions pkg/client/dubbo/dubbo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a679ff2

Please # to comment.