【问题标题】:S3: Outbound adapter to place file in multiple target bucketsS3:将文件放置在多个目标存储桶中的出站适配器
【发布时间】:2018-10-24 08:16:14
【问题描述】:

有一个 Spring Boot 应用程序,我正在尝试使用单个 S3 出站适配器将文件放入多个 S3 存储桶中。

想知道是否可以使用 spring-integration-aws 本身使用单个出站适配器将文件放置在多个存储桶中(不使用 aws -sdk)

任何建议都会有所帮助。

S3:出站适配器:

<int-aws:s3-outbound-channel-adapter id="filesS3Mover"
        channel="filesS3MoverChannel"
        transfer-manager="transferManager"
        bucket="${aws.s3.target.bucket}"
        key-expression="headers.targetsystem-folder/headers.file_name"
        command="UPLOAD">
</int-aws:s3-outbound-channel-adapter>

【问题讨论】:

    标签: spring spring-integration spring-integration-sftp spring-integration-aws


    【解决方案1】:

    不,这样的通道适配器不可能一次发送到多个存储桶。 这不是它的责任。

    你可以有一个:

     <xsd:attribute name="bucket-expression">
            <xsd:annotation>
                <xsd:documentation>
                    A SpEL expression to evaluate S3 bucket at runtime against request message.
                    Mutually exclusive with 'bucket'.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
    

    不过,要在运行时根据消息确定它,并在 &lt;int-aws:s3-outbound-channel-adapter&gt; 前面有一个循环,以在每次迭代时修改一些消息头,并一次又一次地将它们全部发送到同一个通道。

    【讨论】:

    • 你能推荐一些如何循环它的例子吗?已经尝试过 spring-integration-file 但低于异常。成功将文件放置到第一个目标文件夹后,尝试循环到标题丰富的频道。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-12
    • 2019-07-24
    • 2019-11-07
    • 1970-01-01
    • 2021-05-04
    • 1970-01-01
    • 2020-03-20
    相关资源
    最近更新 更多