问题是,在弹簧集成中,入站适配器有preventDuplicates(true)
,这是如何工作的?问题的原因是,如果流量中断并且在终端或中间服务激活器中引发的某些异常未完成,则入站应该能够再次进行此操作。
它默认配置一个AcceptOnceFileListFilter
,它只能防止内存映射重复。
如果你明确地注入一个AcceptOnceFileListFilter
(或者一个可以在持久存储中存储状态的FileSystemPersistentAcceptOnceFileListFilter
),你可以调用remove()
- 它们都实现了ResettableFileListFilter
。
/**
* A {@link FileListFilter} that can be reset by removing a specific file from its
* state.
* @author Gary Russell
* @since 4.1.7
*
*/
public interface ResettableFileListFilter<F> extends FileListFilter<F> {
/**
* Remove the specified file from the filter so it will pass on the next attempt.
* @param f the element to remove.
* @return true if the file was removed as a result of this call.
*/
boolean remove(F f);
}