Spring S3:将文件放入多个目标存储桶的出站适配器
有一个spring引导应用程序,我试图使用单个S3出站适配器将一个文件放入多个S3存储桶中 想知道是否有可能在不使用aws-sdk的情况下,使用SpringIntegrationAWS本身的单个出站适配器将文件放在多个bucket中 任何建议都会有帮助 S3:出站适配器:Spring S3:将文件放入多个目标存储桶的出站适配器,spring,spring-integration,spring-integration-sftp,spring-integration-aws,Spring,Spring Integration,Spring Integration Sftp,Spring Integration Aws,有一个spring引导应用程序,我试图使用单个S3出站适配器将一个文件放入多个S3存储桶中 想知道是否有可能在不使用aws-sdk的情况下,使用SpringIntegrationAWS本身的单个出站适配器将文件放在多个bucket中 任何建议都会有帮助 S3:出站适配器: <int-aws:s3-outbound-channel-adapter id="filesS3Mover" channel="filesS3MoverChannel" transfer-
<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>
不,使用这样的通道适配器不可能一次发送到多个存储桶。 这不是它的责任 您可以选择:
<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>
不过,要在运行时根据一条消息确定它,并在前面有一个循环,您可以在每次迭代中修改一些消息头,并将它们一次又一次地发送到同一个通道。您可以建议一些如何循环的示例吗。已尝试将其用于spring集成文件,但遇到以下异常。在成功将文件放置到第一个目标文件夹后,尝试循环到标题通道。