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.83k stars 922 forks source link

Armeria can supports general SpringMVC and webflux mapping together #2109

Open young891221 opened 5 years ago

young891221 commented 5 years ago

One of the advantages of armeria is that it acts as a connector when used with spring. In this context, I think we have something to appeal. I had a desire to use the usual SpringMVC and webFlux methods together. WebFlux handles redis calls asynchronously and SpringMVC handles RDB processing. In this case, Spring does not support it(Can I use SpringMvc and webflux together?). But our armeria seems to support this approach. Is that right? If it is possible, I want to highlight these advantages in Docs and add them to webFlux example. Please, confirm my opinion.

    @GetMapping("on")
    Mono<String> usingWebflux() {
        return Mono.just("Armeria support Webflux");
    }

    @GetMapping("off")
    String notUsingWebFlux() {
        return "Armeria support SpringMVC";
    }

PS) If that makes sense, I think it would be nice to add it as a comment in stackOverFlow as well.

trustin commented 5 years ago

I'm not really sure if this is supported, because I never tried. Did you try it already? Please let us know if it ever works.

young891221 commented 5 years ago

I'll share after testing.

trustin commented 5 years ago

@young891221 Gentle ping :-)