CodexBloom - Programming Q&A Platform

AWS S3 Transfer Acceleration Not Working as Expected with SDK v2.1.0

👀 Views: 17 💬 Answers: 1 📅 Created: 2025-06-14
AWS S3 Java transfer-acceleration

I'm stuck on something that should probably be simple... I'm experimenting with I'm wondering if anyone has experience with I'm trying to enable S3 Transfer Acceleration for my bucket but it seems to be having no effect when I attempt to upload files using the AWS SDK for Java version 2.1.0..... I've set up my bucket with Transfer Acceleration enabled, but my upload speeds are still sluggish and the requests are going through the standard endpoint instead of the accelerated one. Here's the code snippet I'm using for the upload: ```java S3Client s3 = S3Client.builder().build(); PutObjectRequest putRequest = PutObjectRequest.builder() .bucket("my-accelerated-bucket") .key("my-large-file.zip") .build(); s3.putObject(putRequest, RequestBody.fromFile(Paths.get("/path/to/my-large-file.zip"))); ``` When I check the response, I'm not seeing any indication that the file was uploaded using the accelerated endpoint. I've also looked into the S3 bucket configuration, and it appears that Transfer Acceleration is indeed enabled. I’ve tried adding the `TransferAcceleration` option to my SDK client configuration, but that didn't seem to make any difference either: ```java S3Client s3 = S3Client.builder() .overrideConfiguration(ClientOverrideConfiguration.builder() .putDefaultRequestParameter("x-amz-accelerate", "true") .build()) .build(); ``` Additionally, I checked the endpoint URL and it seems to be defaulting to the standard endpoint. Is there anything I could be missing in my configuration or code that would prevent the Transfer Acceleration from functioning properly? Are there specific headers I need to explicitly set? Any insights would be greatly appreciated! For context: I'm using Java on Linux. Any ideas what could be causing this? I'm working in a Linux environment. Any help would be greatly appreciated! This is my first time working with Java LTS. I'd love to hear your thoughts on this. Thanks in advance!