-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Reactive multipart request support [SPR-14546] #19114
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
Sébastien Deleuze commented I had a look to the current support for non-blocking multipart processing, there are some implementations available. Grizzly
I had also a look to the multipart processing support in the engines we use:
Various remarks:
As a consequence, I think as a first step I would like to experiment with a prototype using NIO Multipart that will allow us to discuss and iterate to find the right API for exposing such feature. Maybe something like a |
Sébastien Deleuze commented I am starting working on a draft PR in order to implement Reactive multipart support using NIO Multipart library underneath. |
Rossen Stoyanchev commented Sébastien Deleuze, multipart requests and form processing are closely related, hence some comments. HTML5 & RFC 7578The Servlet API has a particular way of representing this so let's consider a protocol-level perspective first. HTML5 section 4.10.22 defines form submissions. Form with HTTP GET appends "application/x-www-form-urlencoded" form data to the URI query. Form with HTTP POST submits a body with content type "application/x-www-form-urlencoded" or "multiform/data". For the actual encoding of "multipartform/data" the HTML5 spec refers to RFC 2388 which has been obsoleted by RFC 7578. There are at least 4 basic scenarios to consider.
Servlet API and
|
Sébastien Deleuze commented A draft PR is available for review here. |
Sébastien Deleuze commented While we will use NIO Multipart 1.0 which is not yet fully non-blocking in M3, it is interesting to notice that after discussing with the project lead, a POC based on Reactive Streams should be available in a branch in order to evaluate it as a potential fully non-blocking solution. |
Sébastien Deleuze commented After a meeting with Silvano Riz, the developer of NIO Multipart, we agree on collaborating on a POC that will use Reactor 3 as a foundation to build a truly Reactive Multipart library. The idea is to expose an API like |
Sébastien Deleuze commented I postpone this issue to RC1 since it will require a significant amount of work and testing. |
Sébastien Deleuze commented Please find bellow a summary of current status. We did not find the time Silvano Riz and me to work on a reactive multipart implementation, so currently we use NIO Multipart API which is event-based BUT use blocking IO ( Based on my discussion with Stéphane Maldini and this RxNetty discussion:
My current proposal for 5.0 would be:
For 5.1 target, 2 roads could be explored:
|
Sébastien Deleuze commented I have rebased the commit on latest master. Since it seems we don't have a way to write file in a non blocking way, I think the best we can do is using NIO Mulitpart with small chunks of data in order to avoid blocking too much, and using zero copy where we can (already the case in the code I wrote). Rossen Stoyanchev Arjen Poutsma What is the best way we have to control the size of the body coming from the request to make sure we have for example 8K chunks? Do we already configure that at engine level? |
Sébastien Deleuze commented I have pushed to master the support for Reactive multipart requests available via A demo application is available at https://github.com/sdeleuze/webflux-multipart. Rossen Stoyanchev Feel free to review/polish this support when you have the time. |
Rossen Stoyanchev opened SPR-14546 and commented
This needs to be investigated. I don't know if there is anything in the Servlet API for this that's non-blocking.
Affects: 5.0 M1
Issue Links:
0 votes, 7 watchers
The text was updated successfully, but these errors were encountered: