Replies: 1 comment
-
Since you are using Spring |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using SpringBoot Application to upload files to AWS S3.
My requirement is when file size above 100 MB I need to use multipart upload strategy otherwise use default strategy.
I have gone through the AWS documentation. I am using high level api for multi part upload.
Here is my configuration :
AWSConfig class declared the TransferManager bean.
@bean
public TransferManager transferManager() {
return TransferManagerBuilder.standard()
.withS3Client(s3Client())
.withMultipartUploadThreshold((long) (100000000))
.withExecutorFactory(() -> Executors.newFixedThreadPool(20))
.build();
}
withMultipartUploadThreshold parameter its uses multipart upload if file size greater than 100 mb otherwise it will not use multipart upload strategy.
Incase of large file size its not recommended to block the user till large file uploads in the background. Thats why not using upload.waitForCompletion();
Can someone please suggest do I need to shutdown the transferManager when springboot application shutdown ?
I have seen the examples where we are creating instance of TransferManager object and then shutdowning it.
Since I have declared it as spring bean so not creating instance of transferManager in each upload by manually .
Beta Was this translation helpful? Give feedback.
All reactions