GH-8898: Add AbstractRemoteFileStreamingMessageSource.clearFetchedCache

Fixes: #8898

In some cases not all retched remote files are processed, and after changing the `SessionFactory` (e.g. `RotatingServerAdvice`)
thy might not be processed on the next polling cycle
This commit is contained in:
Karol Kosiacki
2024-02-11 21:41:20 +01:00
committed by Artem Bilan
parent 66ca557a54
commit 753916ca24
5 changed files with 73 additions and 27 deletions

View File

@@ -25,5 +25,7 @@ If the poller is active when the property is changed, the change takes effect on
Starting with version 5.1, the synchronizer can be provided with a `Comparator<?>`.
This is useful when restricting the number of files fetched with `maxFetchSize`.
Also see general xref:sftp/inbound.adoc[SFTP Inbound Channel Adapter] chapter for information about `FileListFilter` configuration.
Starting with version 6.4, the `AbstractRemoteFileStreamingMessageSource` has now a convenient `clearFetchedCache()` API to remove references from cache for not processed remote files.
The references stay in cache because polling configuration does not allow to process all of them in one cycle, and the target `SessionFactory` might be changed between polling cycles, e.g. via `RotatingServerAdvice`.
Also see general xref:sftp/inbound.adoc[SFTP Inbound Channel Adapter] chapter for information about `FileListFilter` configuration.

View File

@@ -83,3 +83,4 @@ public IntegrationFlow flow() {
IMPORTANT: Do not configure a `TaskExecutor` on the poller when using this advice; see xref:changes-4.1-4.2.adoc#x4.2-conditional-pollers[Conditional Pollers for Message Sources] for more information.
Also see a convenient `AbstractRemoteFileStreamingMessageSource.clearFetchedCache()` API when not all fetched files are processed withing a single polling cycle, but `SessionFactory` might be rotated to different one.

View File

@@ -17,4 +17,10 @@ In general the project has been moved to the latest dependency versions.
=== New Components
[[x6.4-general]]
=== General Changes
=== General Changes
[[x6.4-remote-files-changes]]
=== Remote File Adapters Changes
The `AbstractRemoteFileStreamingMessageSource` has now a convenient `clearFetchedCache()` API to remove references from cache for not processed remote files.
The references stay in cache because polling configuration does not allow to process all the fetched in one cycle, and the target `SessionFactory` might be changed between polling cycles, e.g. via `RotatingServerAdvice`.