Move sftpMessageSource.start() out of Publisher
The `AbstractRemoteFileStreamingMessageSource.start()` does nothing, but state change. Therefore, it is safe to call from whenever is convenient for us
This commit is contained in:
@@ -107,11 +107,10 @@ public class SftpSupplierConfiguration {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user