0

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>
Jessie
  • 963
  • 5
  • 16
  • 26

1 Answers1

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.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • Can you suggest some example how to loop it. have tried it for spring-integration-file but getting below exception. Tried to loop to header-en richer channel after successfully placing the file to first target folder. – Jessie Nov 04 '18 at 05:43