Currently experimenting reactive programming with Spring Boot 2.0.0.M4, Spring 5.0.0.RC4 and Reactor 3.1.0.RC1.
Injecting a @RequestScope or @SessionScope bean into a WebFlux REST controller fails at runtime:
java.lang.IllegalStateException: No Scope registered for scope name 'request'
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:342) ~[spring-beans-5.0.0.RC4.jar:5.0.0.RC4]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.0.RC4.jar:5.0.0.RC4]
at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-5.0.0.RC4.jar:5.0.0.RC4]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) ~[spring-aop-5.0.0.RC4.jar:5.0.0.RC4]
at com.adeliosys.scope.Counter$$EnhancerBySpringCGLIB$$7dce0361.increment(<generated>) ~[classes/:na]
at com.adeliosys.scope.Controller.getQuote(Controller.java:25) ~[classes/:na] // line with theScopedBean.doSometing() call in the REST controller
(...)
The blocking equivalent with Spring Web MVC works fine.
I understand that reactive programming messes with thread locals, but is request or session scoped beans injection supported by WebFlux ?
If not, is this planed ?
Thank you for your time.