Conversation
...configure/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java
Outdated
Show resolved
Hide resolved
ST-DDT
left a comment
There was a problem hiding this comment.
Thanks for your contribution.
There are some small changes I would like to see before merging this. See my comments for details.
Also please run ./gradle spotlessApply before committing.
Lastly, please add a test that ensures this works as expected and does not break unnoticed in a future release.
If you need help with any of these, feel free to ask me and I will try to help you.
...t-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/config/MethodConfig.java
Outdated
Show resolved
Hide resolved
...ing-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/config/RetryPolicyConfig.java
Outdated
Show resolved
Hide resolved
...ing-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/config/RetryPolicyConfig.java
Outdated
Show resolved
Hide resolved
...ing-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/config/RetryPolicyConfig.java
Outdated
Show resolved
Hide resolved
...boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/config/GrpcChannelProperties.java
Outdated
Show resolved
Hide resolved
I have settled your proposal and also add GrpcChannelPropertiesGivenMethodConfigUnitTest for test |
|
I'll try to add some integration tests that actually test, that the retry/service config is working. |
Ok just do it |
| if (properties.isRetryEnabled()) { | ||
| builder.enableRetry(); | ||
| // build retry policy by default service config | ||
| // TODO: Wrap field in defaultServiceConfig |
There was a problem hiding this comment.
To avoid conflicts with other values in the serviceConfig it might be neccessary to wrap the methodConfig property in a defaultServiceConfig property for clarity.
| builder.enableRetry(); | ||
| // build retry policy by default service config | ||
| // TODO: Wrap field in defaultServiceConfig | ||
| builder.defaultServiceConfig(buildDefaultServiceConfig(properties)); |
There was a problem hiding this comment.
The default service config might be used outside of the retry logic.
So it might be neccessary to move it "elsewhere".
|
Hey |
|
Currently there appears to be merge conflicts, so this cannot be merged right now. |
1.新增之后需要进行如下所示的配置

grpc.client.tcl-cloud-provider.retry-enabled=true grpc.client.tcl-cloud-provider.method-config[0].name[0].service=helloworld.Greeter grpc.client.tcl-cloud-provider.method-config[0].name[0].method=SayHello grpc.client.tcl-cloud-provider.method-config[0].retry-policy.max-attempts=3 grpc.client.tcl-cloud-provider.method-config[0].retry-policy.initial-backoff=1 grpc.client.tcl-cloud-provider.method-config[0].retry-policy.max-backoff=1 grpc.client.tcl-cloud-provider.method-config[0].retry-policy.backoff-multiplier=2 grpc.client.tcl-cloud-provider.method-config[0].retry-policy.retryable-status-codes=UNKNOWN,UNAVAILABLE2.测试结果如下
EDIT by @ST-DDT
English
References: