Spring-framework: Detect unsupported suspending handler methods in Spring MVC

Created on 4 Sep 2019  路  3Comments  路  Source: spring-projects/spring-framework

Given the reports I already had from people trying to use suspending functions with Spring MVC, better to provide an explicit check for that. Only WebFlux support suspending functions for now.

task

Most helpful comment

Having this assertion in places blocks users to upgrade to Spring Boot 2.2.x when they have already implemented support for suspending handler methods using

https://github.com/konrad-kaminski/spring-kotlin-coroutine/blob/master/spring-webmvc-kotlin-coroutine/src/main/kotlin/org/springframework/kotlin/coroutine/web/CoroutinesWebMvcConfigurer.kt

Could this be fixed, or the only thing would be to wait for the promised Spring Framework 5.3 native Spring MVC support?

All 3 comments

Having this assertion in places blocks users to upgrade to Spring Boot 2.2.x when they have already implemented support for suspending handler methods using

https://github.com/konrad-kaminski/spring-kotlin-coroutine/blob/master/spring-webmvc-kotlin-coroutine/src/main/kotlin/org/springframework/kotlin/coroutine/web/CoroutinesWebMvcConfigurer.kt

Could this be fixed, or the only thing would be to wait for the promised Spring Framework 5.3 native Spring MVC support?

I can't see how a code in WebMvc could trigger such error when just WebFlux is used, could you please share a repro project?

Was this page helpful?
0 / 5 - 0 ratings