Skip to main content Skip to complementary content

Configuring how the message is processed

Procedure

  1. Configure the cAWSConnection using the same properties as in the producer Route.
  2. Double-click the cAWSS3 component to display its Basic settings view in the Component tab.
  3. 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.
  4. Double-click the cProcessor component to display its Basic settings view in the Component tab.
  5. In the Code box, enter the following code to print the file name and its content in the execution console:BufferedReader br = new BufferedReader(new InputStreamReader((InputStream) exchange.getIn().getBody())); System.out.println("FileName: "+exchange.getIn().getHeader("CamelAwsS3Key")+" Content: " + br.readLine()); br.close();
  6. Press Ctrl+S to save your Route.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!