Open
Description
Ankur Pathak opened DATACMNS-1412 and commented
We have this EnableSpringDataWebSuppor in Spring MVC which makes Controller clean
for paging and provides very userful features. But this is not working with Spring Web Flux
Controller. We should extend this support to WebFlux as well. It may be limited support
of waht we have in Spring MVC so as to keep reactive means. Because its a blocker in
migrating existing code in Spring MVC to Spring WebFlux and as it is part of Spring Data Core
it should work with both whether we are in Reactive or not Reactive world
Affects: 2.1.1 (Lovelace SR1)
Reference URL: https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/web/config/EnableSpringDataWebSupport.html
4 votes, 5 watchers
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
matiasah commentedon Jan 15, 2021
I'm guessing
spring-boot-auto-configure
needs aSpringDataWebFluxAutoConfiguration
to be able to declare a custom@EnableSpringDataWebFluxSupport
annotation.However,
@EnableSpringDataWebFluxSupport
can be declared onspring-data-commons
.mp911de commentedon Jan 25, 2021
It makes sense now to add
@EnableSpringDataWebFluxSupport
as we have a number of components that we can register.[-]Support for EnableSpringDataWebSupport in Spring WebFlux Controller Style [DATACMNS-1412][/-][+]Add EnableSpringDataWebFluxSupport for WebFlux support [DATACMNS-1412][/+]matiasah commentedon Jan 25, 2021
I checked
@EnableSpringDataWebSupport
and found that it usesSpringDataWebConfiguration
so I'm guessing it also needs a newSpringDataWebFluxConfiguration
. What other components could possibly be necessary here?mp911de commentedon Jan 26, 2021
We should create a
SpringDataWebFluxConfiguration
that registersReactivePageableHandlerMethodArgumentResolver
andReactiveSortHandlerMethodArgumentResolver
. It would be also neat to spike on a reactive variant ofProjectedPayload
to apply inbound method argument projections.Do you want to submit a pull request or should we go forward adding
SpringDataWebFluxConfiguration
and@EnableSpringDataWebFluxSupport
?wankaiss commentedon Jun 3, 2021
Any update for
SpringDataWebFluxConfigurationSupport
team? I think this will imperative in coming time as reactive becoming more and more popular 😃onacit commentedon Jul 25, 2022
I really need this. Thanks.
matiasah commentedon Jul 26, 2022
@mp911de for
@ProjectedPayload
I assume there needs to be a newProjectingJackson2HttpMessageReader
asWebFluxConfigurer
seems to opt for http message codecs (HttpMessageReader
andHttpMessageWriter
) over instances ofHttpMessageConverter
.For
ProjectingJackson2HttpMessageConverter
it inheritsMappingJackson2HttpMessageConverter
but there's no base class for WebFlux.Should a
MappingJackson2HttpMessageReader
be in scope of spring-data-commons ? What about aProjectingJackson2HttpMessageReader
?Edit: I realized there's
Jackson2JsonDecoder
matiasah commentedon Jul 26, 2022
@mp911de I provided a
ProjectingJackson2JsonDecoder
in #2667 but it needs an additional change I wasn't able to tackle.Do you know how could we implement this method in the new class?
https://github.com/spring-projects/spring-data-commons/blob/main/src/main/java/org/springframework/data/web/ProjectingJackson2HttpMessageConverter.java#L130-L135
matiasah commentedon Jul 29, 2022
@mp911de I tackled the implementation of
ProjectingJackson2JsonDecoder
and tested it with aWebClient
, it worked well but still haven't added Unit Tests yet.Also I provided an implementation for
SpringDataWebFluxConfiguration
in #2667