-
Notifications
You must be signed in to change notification settings - Fork 910
Potential problem in uploading data using AsyncRequestBody.fromPublisher() #2493
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
Hi @masokan,
|
Hi @debora-ito, my application generates content dynamically for which the length is not known beforehand. My understanding is that AsyncRequestBody.fromPublisher() API is meant to send such content. The content is published as a series of ByteBuffer objects that the API accepts and uploads. The content length is defined to be Optional.empty() in AsyncRequestBody.java (which is in aws-java-sdk-v2.) If you think I am using the wrong API, please let me know any other asynchronous API that I can use to upload content for which the length is unknown. Thanks. |
Please take a look at the source code: https://github.com/masokan/test-s3-upload/blob/main/src/main/java/com/mycompany/test/StreamUpload.java |
Hi @debora-ito I think the feature I am looking for (uploading streamed content for which length is unknown) is not supported by AWS Java SDK v2. A quick search landed me on aws/aws-sdk-java#474 where several users were looking for the same missing feature. Also, the strange thing is that the exception is thrown after all data to be uploaded is published by the Publisher. It is not thrown in the call to S3AsyncClient.putObject() itself. |
@masokan we are tracking this as one the many features of the V2 version of TransferManager, aws/aws-sdk-java#474 was brought out in the comments - #37 (comment). I'll go ahead and close this, you can monitor the progress on the TransferManager v2 tracking issue - #37. Feel free to reach out with other questions. |
|
Describe the bug
Exception thrown when normal completion is expected
Expected Behavior
Upload should be successful without any exception
Current Behavior
An exception is thrown
Please see the github repository https://github.com/masokan/test-s3-upload for an example and error log
Steps to Reproduce
Please see https://github.com/masokan/test-s3-upload#readme for more details
Possible Solution
Context
I am trying to upload a stream of data for which the size is unknown
Your Environment
The text was updated successfully, but these errors were encountered: