-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Provide auto-configuration for Spring HATEOAS's new WebFlux integration #16020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@wilkinsona when I do this, I have managed to get things working with WebFlux... <properties>
<java.version>1.8</java.version>
<spring-hateoas.version>1.0.0.BUILD-SNAPSHOT</spring-hateoas.version>
</properties> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
</exclusions>
</dependency> @SpringBootApplication
@EnableHypermediaSupport(type = { HAL, HAL_FORMS })
public class HackingSpringBootApplication {
public static void main(String[] args) {
SpringApplication.run(HackingSpringBootApplication.class, args);
}
} Presumably, because this takes Spring MVC off the classpath and puts WebFlux on the classpath, Spring HATEOAS itself is able to pick the right set of beans to register itself properly. |
In addition to the blocking issues above, a secondary issue is that I don't think we can support the existing If I can get Spring HATEOAS working well enough with WebFlux to confirm the above, I'll open an issue to see if Spring HATEOAS can make it configurable so that the codecs can be configured up front with the desired mime types rather than us having to change them after the fact. |
TL;DR: I think we should move this out of 2.2.x or perhaps even close this. In addition to the ongoing discussions involving @odrotbohm and @bclozel related to media type aliasing which are not going to be resolved in the Framework 5.2/Boot 2.2 timeframe, I am now of the opinion that WebFlux-based auto-configuration will be more of a hinderance than a help to users. Setting aside the
The expanded range of media types that are supported by Spring HATEOAS mean that Boot auto-configuring HAL and only HAL is harder to justify. As soon as the user specifies Adding WebFlux support would also mean that the starter makes little sense any more. It currently contains three dependencies:
To allow the starter to apply to be web stacks, 1 would be removed. Furthermore 3 is no longer needed as As I wrote the above, I realised that much of the same logic could be applied to MVC too. Once the media type aliasing discussion has been resolved (hopefully in the Framework 5.3 timeframe), it may make sense to deprecate Boot's auto-configuration for Spring HATEOAS on the servlet-based web stack. The discussion will hopefully result in a better alternative to Boot's What do you think, @odrotbohm and @gregturn? My reasoning above is based on there actually being very little for Boot to auto-configure these days. If there are, in fact, some more new features for which auto-configuration would make sense then my reasoning will no longer apply. |
Totally with you, Andy. The shim on top of Also, we have tweaked Spring HATEOAS configuration model in a way that it's now using a (Spring Boot) provided Let's see what feedback we get for HATEOAS 1.0 and Boot 2.2 and incorporate that into a sort of clean slate start for 1.1/2.3 with a plausible option of doing exactly nothing. |
Sold. Thanks for the quick response, @odrotbohm. |
* Provide CodecCustomizer to support WebClient. Related: spring-projects#16020
* Provide RestTemplateCustomizer. * Verify RestTemplateCustomizer is also picked up for TestRestTemplate. Related: spring-projects#16020.
* Provide RestTemplateCustomizer. * Verify RestTemplateCustomizer is also picked up for TestRestTemplate. Related: spring-projects#16020.
* Provide RestTemplateCustomizer. * Verify RestTemplateCustomizer is also picked up for TestRestTemplate. Related: spring-projects#16020.
* Provide RestTemplateCustomizer. * Verify RestTemplateCustomizer is also picked up for TestRestTemplate. Related: spring-projects#16020.
* Provide CodecCustomizer for WebTestClient. Related: spring-projects#16020.
* Provide CodecCustomizer for WebTestClient. Related: spring-projects#16020.
* Provide CodecCustomizer for WebTestClient. Related: spring-projects#16020.
* Provide CodecCustomizer for WebTestClient. Related: spring-projects#16020.
* Provide CodecCustomizer for WebTestClient. Related: spring-projects#16020.
* Provide CodecCustomizer for WebTestClient. * Verify it handles one mediatype, multiple mediatypes, and custom mediatypes. Related: spring-projects#16020.
* Provide CodecCustomizer for WebTestClient. * Verify it handles one mediatype, multiple mediatypes, and custom mediatypes. Related: spring-projects#16020.
* Provide CodecCustomizer for WebTestClient. * Verify it handles one mediatype, multiple mediatypes, and custom mediatypes. Related: spring-projects#16020.
* Provide CodecCustomizer to support WebClient. * Add tests to verify one mediatype, multiple mediatypes, and custom mediatypes all properly register with WebClient and CodecConfigurer. Related: spring-projects#16020
* Write test cases that verify WebTestClient will pick up the same autoconfiguration beans created for WebClient. * Verify it handles one mediatype, multiple mediatypes, and custom mediatypes. Related: spring-projects#16020. Resolves spring-projects#20372.
* Write test cases that verify WebTestClient will pick up the same autoconfiguration beans created for WebClient. * Verify it handles one mediatype, multiple mediatypes, and custom mediatypes. Related: spring-projects#16020. Resolves spring-projects#20372.
* Write test cases that verify WebTestClient will pick up the same autoconfiguration beans created for WebClient. * Verify it handles one mediatype, multiple mediatypes, and custom mediatypes. Related: spring-projects#16020. Resolves spring-projects#20372.
* Write test cases that verify WebTestClient will pick up the same autoconfiguration beans created for WebClient. * Verify it handles one mediatype, multiple mediatypes, and custom mediatypes. Related: spring-projects#16020. Resolves spring-projects#20372.
Per our video chat, the following points were agreed upon:
In the meantime, server-side configuration of both Spring MVC and Spring WebFlux will remain squarely maintained inside Spring HATEOAS. And providing APIs for users to easily configure |
Hi, any update on that issue ? So far, I haven't seen anything in the 2.4.× release notes. |
Nothing to report at this time, @rfelgent. The issue remains open so it is to be expected that there's nothing in the 2.4.x release notes. |
A non-exhaustive list of things to consider:
spring-boot-starter-hateoas
is currently MVC specific (it depends onspring-boot-starter-web
)The text was updated successfully, but these errors were encountered: