sdeleuze
05/28/2020, 1:02 PMTristan
05/28/2020, 1:19 PMsdeleuze
05/28/2020, 1:19 PMnfrankel
05/28/2020, 1:27 PMtodd.ginsberg
05/28/2020, 1:50 PMsdeleuze
05/28/2020, 1:56 PMRobert Jaros
05/28/2020, 2:34 PMnfrankel
05/28/2020, 2:47 PMsdeleuze
05/28/2020, 2:51 PMsdeleuze
05/28/2020, 2:52 PMsdeleuze
05/28/2020, 2:52 PMsdeleuze
05/28/2020, 2:53 PMnfrankel
05/28/2020, 2:53 PMnfrankel
05/28/2020, 2:54 PMsdeleuze
05/28/2020, 2:54 PMsdeleuze
05/28/2020, 2:55 PMsdeleuze
05/28/2020, 2:55 PMsdeleuze
05/28/2020, 2:55 PMnfrankel
05/28/2020, 2:58 PMRobert Jaros
05/28/2020, 2:58 PMwebMvc
and webFlux
function were having the same name, the functional configuration would be exactly the same for both mvc and webflux? You only need to change the starter to migrate the project ;-)Robert Jaros
05/28/2020, 3:05 PMTristan
05/28/2020, 3:34 PMsdeleuze
05/28/2020, 4:38 PMIfYeah but require much more other changes so not sure this is a goal 😉andwebMvc
function were having the same name, the functional configuration would be exactly the same for both mvc and webflux? You only need to change the starter to migrate the project 😉webFlux
sdeleuze
05/28/2020, 4:39 PMWould it be possible to introduce local / child application contexts to Spring with this functional approach? Or is this out of the question because of Spring architecture?It is technically possible but I am not sure to want to add this level of complexity. Most modern Spring apps don't really take advantage of app context hierarchy.
sdeleuze
05/28/2020, 4:40 PMAlso, I read a tweet where you talked about some FE stuff, is that related? 🤤@Tristan FE = Front End?
Robert Jaros
05/28/2020, 4:50 PMServerRequest
. We would have request scope working again. Ktor with Guice (which supports child contexts) works in a similar way. With my KVision interfaces to Spring Webflux I'm using horrible hacks to make such simple thing working.sdeleuze
05/28/2020, 5:09 PMsdeleuze
05/28/2020, 5:10 PMTristan
05/28/2020, 5:17 PMRobert Jaros
05/28/2020, 5:18 PM@Bean
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
open fun serverRequest(): ServerRequest {
return threadLocalRequest.get() ?: KVServerRequest()
}
and then I'm using it this way when getting bean from context:
tlReq.set(req)
val service = ctx.getBean(serviceClass.java)
tlReq.remove()
You can find the whole code in KVision spring-boot module:
https://github.com/rjaros/kvision/tree/master/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remotesdeleuze
05/28/2020, 5:19 PMsdeleuze
05/28/2020, 5:19 PM