Skip to content

define multiple grpc port in spring boot  #6

Description

@zoat

In a first moment, I would like to thank you for the work you did.
I want to define fo each grpc service the port for exemple
@GRpcService
public class TotoImpl I want to define a port 5000

and for

@GRpcService
public class TotoImpl I want to define a port 6000
but in my yaml I have grpc:
port: 7000

I have created

@component
public class MyGRpcServerBuilderConfigurer extends GRpcServerBuilderConfigurer{

@Autowired
ToToServiceImpl toToServiceImpl;

public MyGRpcServerBuilderConfigurer() {
super();

}

@OverRide
public void configure(ServerBuilder<?> serverBuilder) {
super.configure(serverBuilder);
serverBuilder.forPort(5000)
.addService(toToServiceImpl).build();
.
}
}
but still don't work I the grpc service is still runnning in the default instead of running in 5000

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions