0

有一个弹簧启动应用程序,我正在尝试使用单个 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>
4

1 回答 1

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>

但是,要在运行时针对消息确定它,并在前面有一个循环,<int-aws:s3-outbound-channel-adapter>以在每次迭代时修改一些消息头,并一次又一次地将它们全部发送到同一个通道。

于 2018-10-24T14:55:48.893 回答