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

Reactive HTTP request forwarding [SPR-14537] #19106

Closed
spring-projects-issues opened this issue Jul 29, 2016 · 4 comments
Closed

Reactive HTTP request forwarding [SPR-14537] #19106

spring-projects-issues opened this issue Jul 29, 2016 · 4 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 29, 2016

Rob Winch opened SPR-14537 and commented

Here is a scenario I find it very useful:

Someone is using Spring Security and we need to present the user with an "authentication prompt". Often times this will vary by content type. So for example, I might need to return an HTTP Basic prompt for application/json but redirect to an HTML page for html request. In the json case the result might even contain some JSON in the body giving the error message.

If we support a concept like forward, this can make it easy to define a Spring @RequestMapping endpoint to process it. This means that the user can easily leverage things like type conversion, argument resolvers, etc.

Otherwise, (as far as I can tell) Spring Security must provide support for all these things or handicap the user with a less flexible API.

I do acknowledge having different "dispatch" types adds quite a bit of complexity, so that might not be worth the tradeoff. However, I thought it was worth bringing up for discussion

Rossen Stoyanchev points out that this would be useful in error handling (i.e. similar to global error handler "forwards" to a controller).


Affects: 5.0 M1

Issue Links:

1 votes, 6 watchers

@spring-projects-issues
Copy link
Collaborator Author

Spencer Gibb commented

Spring Cloud Netflix uses this as a feature, Spring Cloud Gateway (based on WebFlux) would like to provide a similar feature where the proxy routes internally rather than externally.

@spring-projects-issues
Copy link
Collaborator Author

wang guobo commented

I have implemented view forwarding feature in webflux controller, see this fork view forwarding in webflux.

@bclozel
Copy link
Member

bclozel commented Jul 17, 2023

We were considering this as an option when WebFlux was created and decided to keep things simple for a start, as forward dispatches can add complexity to the entire model. In the meantime, we managed to implement lots of features and provide WebFlux support without adding this.

Let's decline this issue, as introducing this concept now is not likely to improve existing support and will add more complexity.

@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Jul 17, 2023
@bclozel bclozel removed this from the 6.x Backlog milestone Jul 17, 2023
@bclozel bclozel added the status: declined A suggestion or change that we don't feel we should currently apply label Jul 17, 2023
@spencergibb
Copy link
Member

In gateway, we end up injecting the Dispatch Handler and using it directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants