16.2. Usage examples


You could consume the bucket content and directly delete the object once consumed

- route:
    from:
      uri: "kamelet:aws-s3-source"
      parameters:
        useDefaultCredentialsProvider: true
        region: "eu-west-1"
        bucketNameOrArn: "kamelets"
      steps:
        - to:
            uri: "kamelet:log-sink"

This kind of approach ensures that the object is consumed just one time and after the consumption it is deleted from the S3 bucket.

The deleteAfterRead property is true by default.

If you set the property to false you’ll consume the same set of objects multiple times and you’ll have to deal with managing the situation.

The ignoreBody option is set to false by default, but you can enable it. With that option set you’re going to ignore the file payload and just consume the object metadata.

You could also define a prefix parameter. With that set you’re going to consume only files starting with that prefix. As an example you could have:

- route:
    from:
      uri: "kamelet:aws-s3-source"
      parameters:
        useDefaultCredentialsProvider: true
        region: "eu-west-1"
        bucketNameOrArn: "kamelets"
        prefix: "foo/"
      steps:
        - to:
            uri: "kamelet:log-sink"

By using the prefix foo/ the files consumed will only come from the folder named foo.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部