-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
RESTEasy Reactive: read ContainerRequestContext getEntityStream in filter resource method payload becomes null #17430
Comments
/cc @FroMage, @geoand, @stuartwdouglas |
could you please update on this issue . it is blocker now |
You essentially need to do what is described in #17280 |
thanks However it is not working . |
Please provide a complete working example and steps on how to reproduce the problem |
It is not working when content type "multipart/form-data" fileUpload becomes null quarkus-fileupload-log-issue.zip Reproduce:- |
@geoand could you please update on this issue. |
Please add a fully working example I can check without having to fill anything in myself and I'll give it another look |
Added a simple project with working example .pls import it as maven project . Actual : Expected : Java version 1.8 |
Thanks. Basically you need to do as #17280 describe, i.e. to buffer the stream. |
Thanks for immediate response . As had mentioned before it works with content type json. I think issue is with Multipart fileupload . |
I will check next week as I am on PTO |
Unfortunately the way we handle things won't work for this use case. The issue is that we reading the entire body in a filter is rathe dodgy and can mess up the subsequent processing by Vert.x (and therefore the Multipart handling)... @FroMage @stuartwdouglas any ideas? |
Is it because Vert.x handles multi-part by bypassing our entity stream? |
Yes, exactly |
Can we detect that someone changed it, and then load it differently frmo vert.x? That won't work for any other custom vert.x-specific handler that bypasses the jax-rs API, but 🤷 |
I would much like to avoid having to do something like that. I would prefer if we could have some kind of special filter that could let the user handle the entire body without messing up the following handlers for Vert.x. |
Not sure we can do that if one of the handlers needs to stream the body into something: there's never any "fullly loaded" representation of the bytes. The best we might be able to do is an API that lets users "see" the byte buffers as we pass them to whatever's consuming them. Not sure it'd help in this case. Sort of like a streaming filter… |
I think we need to write our own Multipart handler, and not rely on Vert.x. |
This gives us a lot more flexibility, and allows it to work with multiple backends. Fixes quarkusio#17430
With the linked PR the example works, if you correct the code to:
|
Thanks a lot. |
This gives us a lot more flexibility, and allows it to work with multiple backends. Fixes quarkusio#17430
Should work for both. |
This gives us a lot more flexibility, and allows it to work with multiple backends. Fixes quarkusio#17430
Describe the bug
Resource method payload becomes null if we do
ContainerRequestContext#getEntityStream in ContainerRequestFilter
Payload : pojo [FileUpload ]
Expected behavior
(Describe the expected behavior clearly and concisely.)
payload shoudn't be null
Actual behavior
(Describe the actual behavior clearly and concisely.)
payload is null
if we remove filter then it works as expected .
quarkus-issue.zip
To Reproduce
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
Or attach an archive containing the reproducer to the issue.
Steps to reproduce the behavior:
please note that added @Blocking
Configuration
# Add your application.properties here, if applicable.
Java version : 1.8
Quarkus version : 1.13.4.Final
We have implemented our application using reactive, had forced to mark it as blocking we have use case to process the request entity at filter .However its not working
Screenshots
(If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
Output of
uname -a
orver
Output of
java -version
GraalVM version (if different from Java)
Quarkus version or git rev
Build tool (ie. output of
mvnw --version
orgradlew --version
)Additional context
(Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered: