zbchi opened a new pull request, #3193:
URL: https://github.com/apache/dubbo-go/pull/3193
### Description
#2741
This PR refactors the Hystrix filter to simplify its configuration approach
by removing the config package.
Users now configure Hystrix commands using the hystrix-go API
directly,aligning with the Sentinel filter's API.
before
```
filter_conf:
hystrix_consumer:
configs:
"Default":
timeout: 1000
...
```
after
```go
import "github.com/afex/hystrix-go/hystrix"
cmdName := "dubbo:consumer:greet.GreetService:::Greet"
hystrix.ConfigureCommand(cmdName, hystrix.CommandConfig{
Timeout: 1000,
MaxConcurrentRequests: 10,
RequestVolumeThreshold: 5,
SleepWindow: 5000,
ErrorPercentThreshold: 50,
})
svc, err := greet.NewGreetService(cli, client.WithFilter("hystrix_consumer"))
```
### benifits
no longer depend on config package
direct api usage, aligns with Sentinel filter configuration approach
### Checklist
- [x] I confirm the target branch is `develop`
- [x] Code has passed local testing
- [x] I have added tests that prove my fix is effective or that my feature
works
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]