S3: Outbound adapter to place file in multiple target buckets

早过忘川 提交于 2019-12-31 05:10:08

问题


have a spring boot application, where I am trying to place a file into multiple S3 bucket using single S3 outbound adapter..

Would like to know if its possible to place the file in multiple bucket using single outbound adapter using spring-integration-aws itself( without using aws -sdk)

Any suggestion will be helpful.

S3 : Outbound adapter:

<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>

回答1:


No, it's not possible with such a channel adapter to send to several buckets at a time. This is not its responsibility.

You can have a :

 <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>

though, to determine it at runtime against a message and have a loop in front of the <int-aws:s3-outbound-channel-adapter> to modify some message header on each iteration and send all of them to the same channel again and again.



来源:https://stackoverflow.com/questions/52964035/s3-outbound-adapter-to-place-file-in-multiple-target-buckets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!