Skip to content
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

Support multiple GRpcServerBuilderConfigurer beans #284

Closed
dimi-nk opened this issue Feb 10, 2022 · 1 comment
Closed

Support multiple GRpcServerBuilderConfigurer beans #284

dimi-nk opened this issue Feb 10, 2022 · 1 comment
Labels
enhancement Auto-generates notes
Milestone

Comments

@dimi-nk
Copy link

dimi-nk commented Feb 10, 2022

I would like to configure the server builder from different aspects of the application. For example, I might have a conditional configuration that changes the executor and another conditional configuration that adds an interceptor. It is easier to create multiple, focused configurers rather than create a single configurer where I need to do all the above.

Unless I'm missing something, I'm only allowed to define a single GRpcServerBuilderConfigurer @Bean in my application - it throws an ambiguous bean definition otherwise.

I can obviously work around the issue by creating my own "customizer". I can inject a list of "customizers" to the configurer bean definition and pass the builder to all of them, e.g.

interface ServerBuilderCustomizer {
  void customize(ServerBuilder<?> serverBuilder) 
}

@Bean
public GRpcServerBuilderConfigurer example(List<ServerBuilderCustomizer> customizers) {
  return new GRpcServerBuilderConfigurer() {
    public void configure(ServerBuilder<?> serverBuilder) {
      customizers.forEach(customizer -> customizer.customize(serverBuilder));
    }
  };
}

However, it would be easier if the library accepted a list of configurers in the first place. Let me know if you have any thoughts.

@dimi-nk dimi-nk changed the title Support for multiple GRpcServerBuilderConfigurer beans Support multiple GRpcServerBuilderConfigurer beans Feb 10, 2022
@jvmlet jvmlet added this to the 4.7.0 milestone Mar 10, 2022
@jvmlet jvmlet added the enhancement Auto-generates notes label Mar 10, 2022
@jvmlet jvmlet modified the milestones: 4.7.0, 4.7.1 Apr 7, 2022
@jvmlet jvmlet modified the milestones: 4.7.1, 4.8.0 Jun 14, 2022
@jvmlet jvmlet closed this as completed in d0268d7 Jul 18, 2022
@jvmlet
Copy link
Collaborator

jvmlet commented Jul 18, 2022

@dimi-nk , 4.8.0 is out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Auto-generates notes
Projects
None yet
Development

No branches or pull requests

2 participants