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.78k stars 904 forks source link

Using Armeria with dropwizard #4630

Open vanhuuan opened 1 year ago

vanhuuan commented 1 year ago

I have a old graphhopper project use dropwizard to run a REST server. I want to implement Armeria to use gRPC service. This is my initialize method:

@Override
    public void initialize(Bootstrap<GraphHopperServerConfiguration> bootstrap) {
        ArmeriaBundle<GraphHopperServerConfiguration> bundle = new ArmeriaBundle<>() {
            @Override
            public void configure(ServerBuilder builder) {
                final GrpcService grpcService = GrpcService.builder()
                                .addService(new DirectionServiceImpl())
                                .addService(ProtoReflectionService.newInstance())
                                .supportedSerializationFormats(GrpcSerializationFormats.values())
                                .enableUnframedRequests(true)
                                .build();
                builder.service(grpcService)
                        .service("prefix:/prefix", grpcService);
            }
        };
        bootstrap.addBundle(bundle);
        bootstrap.addBundle(new GraphHopperBundle());
        bootstrap.addBundle(new RealtimeBundle());
        bootstrap.addCommand(new ImportCommand());
        bootstrap.addCommand(new MatchCommand());
        bootstrap.addBundle(new AssetsBundle("/com/graphhopper/maps/", "/maps/", "index.html"));
        bootstrap.addBundle(new AssetsBundle("/META-INF/resources/webjars", "/webjars/", null, "webjars"));
    }

But it's only run Armeria gRPC service and ignore Dropwizard origin method. Can anyone help me. Thanks for your help.

jrhee17 commented 1 year ago

Hi! Let me look into this 😅