Skip to content

Commit

Permalink
Move sftpMessageSource.start() out of Publisher
Browse files Browse the repository at this point in the history
The `AbstractRemoteFileStreamingMessageSource.start()` does nothing, but state change.
Therefore, it is safe to call from whenever is convenient for us
  • Loading branch information
artembilan committed Jan 8, 2024
1 parent 476bb6d commit 5d4cee0
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ public Supplier<Flux<? extends Message<?>>> sftpSupplier(
Flux<? extends Message<?>> flux = (sftpReadingFlow != null) ? Flux.from(sftpReadingFlow)
: sftpMessageFlux(sftpMessageSource, sftpSupplierProperties);

return () -> flux.doOnSubscribe((sub) -> {
if (sftpMessageSource instanceof Lifecycle lifecycle) {
lifecycle.start();
}
});
if (sftpMessageSource instanceof Lifecycle lifecycle) {
lifecycle.start();
}
return () -> flux;
}

@Bean
Expand Down

0 comments on commit 5d4cee0

Please sign in to comment.