PUT requests do not support setReadLimit option
Describe the bug
Reopening #3559 I still don't see any solution to how we can set a read limit when uploading an object with transfer manager using UploadRequest
Expected Behavior
Expose set read limit or an equivalent to set this variable
Current Behavior
"read time out" errors.
Reproduction Steps
Code:
UploadRequest request = UploadRequest.builder().putObjectRequest(
PutObjectRequest.builder().bucket(bucket).key(key).cacheControl(S3_CACHE_CONTROL_HEADER)
.contentMD5(getMd5ObjectContent(key)).metadata(getObjectMetadata(key)).build())
.build();
// request.getRequestClientOptions().setReadLimit((int) (object.getObjectMetadata().getContentLength() + 1));
// Looks like we can't set the read limit https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/best-practices.html
Upload upload = transferManager.upload(request);
Possible Solution
Expose setReadLimit to UploadRequest
Additional Information/Context
No response
AWS Java SDK version used
2.25.47
JDK version used
8
Operating System and version
Mac
This is something even recommend it at the end of this documentation
Hi @facuqubika,
Thank you for reporting the issue. Can you please check if this PR https://github.com/aws/aws-sdk-java-v2/pull/4643 addresses your requirement? Per this change, it allows users to configure max read limit in V2 on Async clients. And with the Sync clients, this could be achieved via RequestBody, (RequestBody#fromContentProvider).
Regards, Chaitanya
It looks like this issue has not been active for more than five days. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please add a comment to prevent automatic closure, or if the issue is already closed please feel free to reopen it.