fix(spring): refactor retry settings to service and method-level nested properties#1143
Conversation
src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesFull.golden
Outdated
Show resolved
Hide resolved
src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpc.golden
Outdated
Show resolved
Hide resolved
zhumin8
left a comment
There was a problem hiding this comment.
LGTM!
Dropped a small comment and 2 reminder notes below.
src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringPropertiesGrpc.golden
Outdated
Show resolved
Hide resolved
| .setPakkage(packageName) | ||
| .build()); | ||
|
|
||
| // TODO: This should move to static types once class is added into spring-cloud-gcp-core |
There was a problem hiding this comment.
Leaving a note here, we will need to load spring-cloud-gcp dependency from local .m2 instead of maven central, since the change is not published yet.
Change will be similar to Blake's commit here.
There was a problem hiding this comment.
@zhumin8 On a second thought, do you think it would be easier to leave this as a dynamic type in generator code until the shared classes are published and available in maven central?
Let me know if there's anything I'm missing here - currently, this use of dynamic type unblocks code generation, and the generated code is able to compile against a locally installed snapshot jar of spring-cloud-gcp.
There was a problem hiding this comment.
I think we can leave as dynamic type temporarily and unblock.
But we do need to switch to local repo for spring-cloud-gcp dependencies eventually to develop on the snapshot version.
currently, this use of dynamic type unblocks code generation, and the generated code is able to compile against a locally installed snapshot jar of spring-cloud-gcp.
yes. But same argument on adding concrete types for other spring denpendencies, it's safer to have the imported class confirmed in the generator than validate via compile in generated module.
There was a problem hiding this comment.
Gotcha, that makes sense. Thank you for the explanation!
src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java
Show resolved
Hide resolved
|
Kudos, SonarCloud Quality Gate passed! |








This PR goes together with GoogleCloudPlatform/spring-cloud-gcp#1392 and builds on top of commits from #1140. It:
Refactors the current setup (method-level and individual settings) to use a nested Retry object provided through properties at both service-level and method-level (poc).