Skip to content

Commit 376e98f

Browse files
authored
Merge pull request #7 from jcustovic/content_length_s3
Add content-length value when uploading to S3
2 parents 8d6bd9e + 6321267 commit 376e98f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The project **Data Exchange Client** allows you to connect to SFTP or FTP servers and configure upload and download pullers.
22

3-
Current stable version: **1.5.0**
3+
Current stable version: **1.5.1**
44

55
## How to use
66

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.dataexchange</groupId>
77
<artifactId>data-exchange-client</artifactId>
8-
<version>1.5.0</version>
8+
<version>1.5.1</version>
99
<packaging>jar</packaging>
1010

1111
<name>data-exchange-client</name>

src/main/java/com/dataexchange/client/config/flows/S3Flow.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public class S3Flow {
4545

4646
public void uploadSetup(String configName, S3Configuration config, String username) {
4747
IntegrationFlowBuilder s3Flow = IntegrationFlows
48+
// TODO add a taskExecutor to poller config for parallel processing
4849
.from(Files.inboundAdapter(new File(config.getInputFolder())).preventDuplicates(true).autoCreateDirectory(true),
4950
conf -> conf.poller(Pollers.fixedRate(2000).maxMessagesPerPoll(100)))
5051
.enrichHeaders(h -> h.headerExpression(FileHeaders.ORIGINAL_FILE, "payload.path"))
@@ -55,6 +56,7 @@ public void uploadSetup(String configName, S3Configuration config, String userna
5556
TransferManager tf = TransferManagerBuilder.standard().withS3Client(initS3Client(config)).build();
5657

5758
ObjectMetadata objectMetadata = new ObjectMetadata();
59+
objectMetadata.setContentLength(payload.length());
5860
if (config.getServerSideEncryption()) {
5961
objectMetadata.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION);
6062
}

0 commit comments

Comments
 (0)