line / armeria

Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
https://armeria.dev
Apache License 2.0
4.73k stars 899 forks source link

Suggest adding an example when armeria + spring is used for docs. #5703

Open eottabom opened 1 month ago

eottabom commented 1 month ago

It would be nice to have an example when you used armeria + spring for docs. I think it will be used a lot as an amaria + spring combination.

For example

When using GrpcService (https://armeria.dev/docs/server-grpc) Register the ArmeriaServerConfigurator with a bean, It would be nice if the examples I use were added.

As below..

@Configuration
public class GrpcServerConfig {

    private final MyHelloService myHelloService;

    public ArmeriaServerConfig(MyHelloService myHelloService) {
        this.myHelloService= myHelloService;
    }

    @Bean
    public ArmeriaServerConfigurator armeriaServerConfigurator() {
        return (serverBuilder) -> {

            GrpcServiceBuilder grpcServiceBuilder = GrpcService.builder()
                    .addService(this.myHelloService);

            serverBuilder.service(grpcServiceBuilder.build());
        };
    }
}