Replies: 5 comments 19 replies
-
/cc @FroMage, @geoand, @stuartwdouglas |
Beta Was this translation helpful? Give feedback.
-
Nothing exists out of the box. Can you describe the scenario in a little more detail? Thanks |
Beta Was this translation helpful? Give feedback.
-
Basically we have uploads that may be rather large. For smaller requests the uploaded data is stored locally in our database cluster but for larger uploads we store the data indirectly in S3. So the goal is to receive the initial request and decide if we will store the data locally or in S3. If storing locally, obviously we want to return This will allow us to offload large uploads completely to S3 without altering the API or requiring the decision logic to be pushed to the client. |
Beta Was this translation helpful? Give feedback.
-
Since nothing currently exists, I was trying to determine a good "interface" that would fit with JAX-RS/RestEasy Reactive. It seems like it should be doable without any special annotations or interface changes. Just declaring a For special cases (e.g. redirection), the resource method can throw an appropriate So something along the lines of... @Path("/upload")
public class UploadsResource {
@POST
public void upload(Uni<byte[]> bodyStream, @HeaderParam("Content-Length") Integer contentLength) {
if (contentLength != null && contentLength > LOCAL_STORE_THRESHOLD) {
URI redirectLocation = s3PreSigner.presignGetObject(...);
throw RedirectionException(Response.Status.OK, redirectLocation);
}
storeRequest(bodyStream);
}
} |
Beta Was this translation helpful? Give feedback.
-
That's a very interesting use-case. This sounds a lot like a custom pre-condition. JAX-RS already has an API for standard HTTP pre-conditions: https://quarkus.io/guides/resteasy-reactive#preconditions I wonder who handles the Perhaps in normal cases we want to handle it automatically (not even sure), and then disable the automatic handling with an annotation such as I realise that our documentation mentions how to stream blocking request bodies, but not async ones: https://quarkus.io/guides/resteasy-reactive#accessing-the-request-body this is a bug on our part. I'm not even sure what async streaming we support for the request body. Do you know, @geoand @stuartwdouglas ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We have a case where we sometimes need to control the response when the
Expect: 100-continue
header is present. For example, before receiving the entire request body we might want to forward the upload to a new destination.Is there a means to do this with RestEasy Reactive?
Beta Was this translation helpful? Give feedback.
All reactions