Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-17440

Initial exception Flux should be handled the same way in servlet stack as in reactive stack

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.0.10
    • Fix Version/s: 5.2 RC1
    • Component/s: Web
    • Labels:
      None

      Description

      Consider the following code:

      @RequestMapping("/1")
      Flux<String> v1()
          return Flux.error(new ResponseStatusException(BAD_REQUEST));
      
      @RequestMapping("/2")
      Flux<String> v2()
          return Flux.concat(Flux.just("x"),Flux.error(new ResponseStatusException(BAD_REQUEST)));
      

       
      In reactive stack initial exception has special treatment: class ChannelSendOperator has special state NEW: /** No emissions from the upstream source yet. */

      Due special treatment http response status for /1 is 400 and for /2 is 200
      In servlet stack http response status for both endpoints is 200

      Nice to have consistent implementation. Reactive stack way is correct one.

        Attachments

          Activity

            People

            Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            michaldo Michal Domagala
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              3 years, 30 weeks, 3 days ago