-
Notifications
You must be signed in to change notification settings - Fork 47
WIP: Split NamedChannel out of autoconfigure #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Split NamedChannel out of autoconfigure #74
Conversation
|
||
import java.time.Duration; | ||
|
||
public record NamedChannel(String address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, there will be more fields here (just a sample)
import org.springframework.core.env.Environment; | ||
import org.springframework.core.env.StandardEnvironment; | ||
|
||
public class NamedChannelRegistry implements EnvironmentAware, VirtualTargets { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will handle the virtual targets lookups but its now divorced of config props.
@@ -48,14 +48,22 @@ ClientInterceptorsConfigurer clientInterceptorsConfigurer(ApplicationContext app | |||
return new ClientInterceptorsConfigurer(applicationContext); | |||
} | |||
|
|||
@Bean | |||
NamedChannelRegistry namedChannelRegistry(GrpcClientProperties properties) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the abstraction used in core now
@@ -39,23 +36,16 @@ | |||
import io.grpc.netty.NettyChannelBuilder; | |||
|
|||
@ConfigurationProperties(prefix = "spring.grpc.client") | |||
public class GrpcClientProperties implements EnvironmentAware { | |||
public class GrpcClientProperties { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note we still keep all the config props named channel variant here which is needed for type-safe config props, auto-completion in IDE, etc.. We just map them to the NamecChannel records in core (registry)
Closing in favor of #89 |
No description provided.