GH-2776: Fix Streaming Remote File MessageSource

Fixes https://github.com/spring-projects/spring-integration/issues/2776
Also see https://github.com/spring-projects/spring-integration/issues/2777

- reset the filter for the current file if the fetch fails
- implement `Lifecycle` and clear the `toBeReceived` queue and corresponding
  filter entries

* Polishing - PR Comments **cherry-pick to all supported**

* Polishing

# Conflicts:
#	spring-integration-file/src/test/java/org/springframework/integration/file/remote/StreamingInboundTests.java
#	spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpStreamingMessageSourceTests.java
#	spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcJavaConfigTests.java
This commit is contained in:
Gary Russell
2019-03-01 14:35:31 -05:00
committed by Artem Bilan
parent 298d10ee40
commit 648760bb43
5 changed files with 204 additions and 95 deletions

View File

@@ -81,7 +81,8 @@ public class StoredProcJavaConfigTests {
public void test() {
Message<?> received = fooChannel.receive(10000);
assertNotNull(received);
Collection<?> primes = (Collection<?>) received.getPayload();
@SuppressWarnings("unchecked")
Collection<Integer> primes = (Collection<Integer>) received.getPayload();
assertThat(primes, Matchers.<Object>contains(2, 3, 5, 7));
received = fooChannel.receive(100);
// verify maxMessagesPerPoll == 1