5.10. MoveAfterRead consumer 选项


除了删除AfterRead它外,还添加了另一个选项,请 moveAfterRead。启用此选项后,消耗的对象将移到目标目标Bucket 中,而不是只删除。这将需要指定 destinationBucket 选项。例如:

  from("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&moveAfterRead=true&destinationBucket=myothercamelbucket")
  .to("mock:result");

在这种情况下,所使用的对象将移到 myothercamelbucket 存储桶并从原始对象中删除(因为 deleteAfterRead 设为 true 为默认值)。

您还可以在将文件移动到不同的存储桶时使用密钥前缀/suffix。这些选项是 destinationBucketPrefix 和 destinationBucketSuffix。

使用以上示例,您可以执行以下操作:

  from("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&moveAfterRead=true&destinationBucket=myothercamelbucket&destinationBucketPrefix=RAW(pre-)&destinationBucketSuffix=RAW(-suff)")
  .to("mock:result");

在这种情况下,所使用的对象将移到 myothercamelbucket 存储桶并从原始对象中删除(因为 deleteAfterRead 设为 true 为默认值)。

因此,如果文件名称为 test,在 myothercamelbucket 中,您应该会看到名为 pre-test-suff 的文件。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.