- Configure the cAWSConnection using the same properties as in the producer Route.
Double-click the cAWSS3 component to display its
Basic settings view in the Component tab.
In the Connection list, select the cAWSConnection component to connect to Amazon's S3 service.
In the Bucket Name field, enter the name of the bucket that contains the file to be consumed,
"talend-s3-demo"in this use case.In the File Name field, enter the name of the file, "talend.txt".Clear the Delete After Read check box to keep the S3 object file after it is consumed.
Double-click the cProcessor component to
display its Basic settings view in the
In the Code box, enter the following code to print the
file name and its content in the execution
BufferedReader br = new BufferedReader(new InputStreamReader((InputStream) exchange.getIn().getBody())); System.out.println("FileName: "+exchange.getIn().getHeader("CamelAwsS3Key")+" Content: " + br.readLine()); br.close();
- Press Ctrl+S to save your Route.