【发布时间】:2018-09-06 04:49:39
【问题描述】:
我正在寻找 AWS s3 Spring 集成文件修改监视器示例。
要求:每当从 AWS S3 存储桶中修改文件时,必须将最新更改从 s3 传输到 EC2 实例。
我们有文件入站适配器的监视事件,但我正在寻找类似的适配器或用于 s3 操作的逻辑。
我们现在拥有的:
<int-file:inbound-channel-adapter id="modifiedFiles" directory="${input.directory}" use-watch-service="true" filter="acceptAllFilter" watch-events="MODIFY"/>
XML 配置:
<bean id="acceptOnceFilter"
class="org.springframework.integration.file.filters.AcceptOnceFileListFilter" />
<integration:channel id="s3FilesChannel" />
<int-aws:s3-inbound-channel-adapter id="s3FilesChannelId" channel="s3FilesChannel"
session-factory="s3SessionFactory"
auto-create-local-directory="false"
delete-remote-files="false"
preserve-timestamp="true"
local-directory="file:${localFilePath}"
local-filter="acceptOnceFilter"
remote-directory-expression="${bucket_name}"
auto-startup="false"
filename-regex="${regx_expresion}"
remote-file-separator="/" >
<integration:poller fixed-delay="1000"/>
</int-aws:s3-inbound-channel-adapter>
<integration:channel id="s3FilesChannel">
<integration:queue/>
</integration:channel>
【问题讨论】:
-
请向我们提供您使用的代码,以便我们以更好的方式帮助您。
-
Himanshu,感谢您的回复。我还没有开始编码,只是分析这种类型的需求。
-
为 s3 bucket 寻找类似的解决方案。
跨度> -
欢迎来到 Stack Overflow!其他用户将您的问题标记为低质量和需要改进。我重新措辞/格式化您的输入,使其更易于阅读/理解。请查看我的更改以确保它们反映您的意图。如果您对我有其他问题或反馈,请随时给我留言。
-
请注意:切勿在 cmets 中添加更多信息。始终更新您的问题。
标签: spring-boot spring-integration spring-integration-aws