Skip to content
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

Warn users that Spring Web is not compatible with Spring Cloud Gateway #653

Closed
raphaelbauer opened this issue Mar 9, 2021 · 3 comments
Closed
Assignees

Comments

@raphaelbauer
Copy link

... but we can still select it.

That's a problem especially for new Spring Boot users. They get a broken setup.

More here: https://twitter.com/Raphael_A_Bauer/status/1368963655598022658

Thanks for your efforts!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 9, 2021
@snicoll
Copy link
Contributor

snicoll commented Mar 9, 2021

Thanks for creating the issue. We've discussed this one yesterday and the current arrangement is a bit at odds with the general philosophy of entries being "additive" or producing certain fine tuning when combined.

Spring Data REST is also in the same situation as it brings spring-boot-starter-web and would downgrade someone willing to use weblux to use MVC. This does not happen for you as Spring Boot considers that you want to use MVC when you combine both the web and the webflux starter. Adding gateway and MVC means that Spring Boot starts in MVC mode and hence breaks your wish to use Spring Cloud Gateway.

A short term idea if you combine both would be to remove spring-boot-starter-web and add a warning in HELP.MD that we've "downgraded you".

A long term idea would be to make those links more explicit but that's a totally different direction considering we need to express those rules in the metadata (for IDEs support) and handle CLI clients that don't have a wizard to generate the projects.

I've flagged this issue for team attention to see if my short term idea is worth pursuing.

@snicoll
Copy link
Contributor

snicoll commented Mar 9, 2021

Starting an app with "Web" and "Gateway" leads to:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method modifyRequestBodyGatewayFilterFactory in org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.

@snicoll
Copy link
Contributor

snicoll commented Mar 10, 2021

I've reported the above to the Spring Cloud Gateway project as I think the failure analysis is too low-level and doesn't really explain what the problem is. Doing so and brainstorming so more lead me to think about setting spring.main.web-application-type to reactive. Doing so works but this time leads to a dedicated warning in Spring Cloud Gateway (see linked issue).

With that in mind, I think the only option is to downgrade to Webflux.

@snicoll snicoll self-assigned this Mar 22, 2021
@snicoll snicoll changed the title Spring Web not compatible with Spring Gateway Warn users that Spring Web is not compatible with Spring Cloud Gateway Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants