You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes: spring-projects#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
Copy file name to clipboardExpand all lines: spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractRemoteFileStreamingMessageSource.java
+21-10Lines changed: 21 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -183,16 +183,27 @@ public void start() {
183
183
@Override
184
184
publicvoidstop() {
185
185
if (this.running.compareAndSet(true, false)) {
186
-
if (this.filter == null || this.filter.supportsSingleFileFiltering()) {
187
-
this.toBeReceived.clear();
188
-
}
189
-
else {
190
-
// remove unprocessed files from the queue (and filter)
Copy file name to clipboardExpand all lines: spring-integration-file/src/test/java/org/springframework/integration/file/remote/RemoteFileStreamingMessageSourceTests.java
+40-14Lines changed: 40 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2015-2022 the original author or authors.
2
+
* Copyright 2015-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/sftp/max-fetch.adoc
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25,5 +25,7 @@ If the poller is active when the property is changed, the change takes effect on
25
25
Starting with version 5.1, the synchronizer can be provided with a `Comparator<?>`.
26
26
This is useful when restricting the number of files fetched with `maxFetchSize`.
27
27
28
-
Also see general xref:sftp/inbound.adoc[SFTP Inbound Channel Adapter] chapter for information about `FileListFilter` configuration.
28
+
Starting with version 6.4, the `AbstractRemoteFileStreamingMessageSource` has now a convenient `clearFetchedCache()` API to remove references from cache for not processed remote files.
29
+
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`.
29
30
31
+
Also see general xref:sftp/inbound.adoc[SFTP Inbound Channel Adapter] chapter for information about `FileListFilter` configuration.
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/sftp/rotating-server-advice.adoc
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -83,3 +83,4 @@ public IntegrationFlow flow() {
83
83
84
84
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.
85
85
86
+
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.
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/whats-new.adoc
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,4 +17,10 @@ In general the project has been moved to the latest dependency versions.
17
17
=== New Components
18
18
19
19
[[x6.4-general]]
20
-
=== General Changes
20
+
=== General Changes
21
+
22
+
[[x6.4-remote-files-changes]]
23
+
=== Remote File Adapters Changes
24
+
25
+
The `AbstractRemoteFileStreamingMessageSource` has now a convenient `clearFetchedCache()` API to remove references from cache for not processed remote files.
26
+
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`.
0 commit comments