Allow named channels to inherit default configuration#347
Allow named channels to inherit default configuration#347o-shevchenko wants to merge 1 commit intospring-projects:mainfrom
Conversation
707a333 to
1218da9
Compare
c8c0055 to
04de180
Compare
onobc
left a comment
There was a problem hiding this comment.
Thank you for another awesome contribution @o-shevchenko . I have left a few comments, other than that we are close to merge.
...e/src/main/java/org/springframework/boot/grpc/client/autoconfigure/GrpcClientProperties.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/springframework/boot/grpc/client/autoconfigure/GrpcClientProperties.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/springframework/boot/grpc/client/autoconfigure/GrpcClientProperties.java
Show resolved
Hide resolved
Signed-off-by: Oleksandr Shevchenko <oleksandr.shevchenko@datarobot.com>
Allows definining a set of channel defaults (`spring.grpc.client.channel-defaults`) that are applied to the default channel, named channels, and unkwnown channels when their `inherit-defaults` property is set to `true`. Original Pull Request #347 Resolves #345 Signed-off-by: Oleksandr Shevchenko <oleksandr.shevchenko@datarobot.com>
Adds back in code level defaults to channel config which give the benefit of automatic metadata generation which contains the default values. Without this the additional metadata json file would need to be maintained manually. Moves from `spring.grpc.client.channel.defaults` to `spring,.grpc.client.channel-defaults` to simplify the nested classes and match the naming of the default channel which is `spring.gprc.client.default-channel`. Adds in `ChannelConfigUtils` to handle the nasty diff detection. Modifies the tests so that the GrpcClientPropertiesTests ensure that the defaults are applied in the proper scenarios but does not test the application of all fields. The fields are instead heavily verified in the config utils tests. Original Pull Request #347 See #345 Signed-off-by: onobc <chris.bono@gmail.com>
|
Thanks for the great contribution @o-shevchenko , nice work! I did add a follow-on commit (d2266d7) which applies the defaults to the following channels when their
Also, moved the defaults back to code w/ the "diff detection" being "did the user change the value from the coded default in the class". See my commit msg for reasoning. Again, since this is about to go into Spring Boot, and all auto-config / props will be under scrutiny I wanted to get this in asap. Otherwise I would have done more back/forth to get your opinion on my recent updates. Please review and we can address any of your concerns in subsequent movements. Thanks, Closing via 0bc8c88. |
|
Thanks @onobc ! |
Named channels now inherit settings from default configuration. Explicitly configured values in named channels take precedence over defaults.
[resolves #345]