Java 在不同的服务器中触发2个spring集成,但使用1个相同的文件轮询文件夹

Java 在不同的服务器中触发2个spring集成,但使用1个相同的文件轮询文件夹,java,spring,spring-integration,Java,Spring,Spring Integration,我正在使用int file:inbound channel adapter处理该文件 我在2差分服务器中获得了2int文件:入站通道适配器,但正在轮询同一文件夹 2个侦听器将侦听1个相同的服务器文件夹。侦听器1无法处理该消息,因为它已由侦听器2处理。错误如下所示 听众1:- 2014-12-20 22:15:27.608 [task-scheduler-3] DEBUG org.springframework.integration.file.FileReadingMessageSource -

我正在使用
int file:inbound channel adapter
处理该文件

我在2差分服务器中获得了2
int文件:入站通道适配器
,但正在轮询同一文件夹

2个侦听器将侦听1个相同的服务器文件夹。侦听器1无法处理该消息,因为它已由侦听器2处理。错误如下所示

听众1:-

2014-12-20 22:15:27.608 [task-scheduler-3] DEBUG org.springframework.integration.file.FileReadingMessageSource - Added to queue: [/folder/101.txt]

2014-12-20 22:15:27.715 [task-scheduler-3] DEBUG org.springframework.integration.file.FileWritingMessageHandler - org.springframework.integration.file.FileWritingMessageHandler@502a3135 received message: [Payload=/folder/101.txt][Headers={timestamp=1419084927715, id=f5bb68b3-0eac-40a6-8fcf-8ba54fc295af}]
2014-12-20 22:15:27.724 [task-scheduler-3] INFO  org.springframework.integration.file.FileWritingMessageHandler - Failed to move file '/folder/101.txt'. Using copy and delete fallback.
听众2:-

2014-12-20 22:15:27.585 [task-scheduler-6] DEBUG org.springframework.integration.file.FileReadingMessageSource - Added to queue: [/folder/101.txt]

2014-12-20 22:15:27.711 [task-scheduler-6] DEBUG org.springframework.integration.file.FileWritingMessageHandler - org.springframework.integration.file.FileWritingMessageHandler@1447034b received message: [Payload=/folder/101.txt][Headers={timestamp=1419084927710, id=2177d3cd-fbd9-4412-98d1-48ce84874b53}]
所以我怀疑的是,两个侦听器的有效负载消息都得到了该文件。但是在1个侦听器已经处理了文件之后,第二个侦听器将出现错误

部分代码如下所示:-

<int-file:inbound-channel-adapter id="Id1" directory="/folder" prevent-duplicates="false">
    <int:poller id="poller" fixed-rate="10000" max-messages-per-poll="1" />
</int-file:inbound-channel-adapter>

<int-file:outbound-gateway 
    request-channel="Id1" reply-channel="Id1Processing"
    directory="/folder/backup}" delete-source-files="true"/>


感谢有人能帮忙。谢谢。

让我猜一下:您不想在第二台服务器上处理同一个文件以避免该错误。为此,您应该使用
过滤器作为参考。考虑使用一些框外的代码<代码>元代码>或代码>或实现您自己的一个。

当前代码使用AbjuttEnAutoTeTrIsListor在DB中过滤处理过的文件。因为如果有任何错误,我希望处理相同的文件名。可以演示如何实现此FileSystemTempersistentAcceptonCefileListFilter吗?