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