diff --git a/supplier/spring-sftp-supplier/src/main/java/org/springframework/cloud/fn/supplier/sftp/SftpSupplierConfiguration.java b/supplier/spring-sftp-supplier/src/main/java/org/springframework/cloud/fn/supplier/sftp/SftpSupplierConfiguration.java index e7447b6a..240d0cb3 100644 --- a/supplier/spring-sftp-supplier/src/main/java/org/springframework/cloud/fn/supplier/sftp/SftpSupplierConfiguration.java +++ b/supplier/spring-sftp-supplier/src/main/java/org/springframework/cloud/fn/supplier/sftp/SftpSupplierConfiguration.java @@ -100,7 +100,8 @@ public class SftpSupplierConfiguration { private static final String FILE_MODIFIED_TIME_HEADER = "FILE_MODIFIED_TIME"; @Bean - public Supplier>> sftpSupplier(MessageSource sftpMessageSource, + public Supplier>> sftpSupplier( + @Qualifier("sftpMessageSource") MessageSource sftpMessageSource, @Nullable Publisher> sftpReadingFlow, SftpSupplierProperties sftpSupplierProperties) { Flux> flux = (sftpReadingFlow != null) ? Flux.from(sftpReadingFlow) @@ -115,8 +116,8 @@ public Supplier>> sftpSupplier(MessageSource sftpMe @Bean @Primary - public MessageSource sftpMessageSource(MessageSource messageSource, BeanFactory beanFactory, - @Nullable List receiveMessageAdvice) { + public MessageSource sftpMessageSource(@Qualifier("targetMessageSource") MessageSource messageSource, + BeanFactory beanFactory, @Nullable List receiveMessageAdvice) { if (CollectionUtils.isEmpty(receiveMessageAdvice)) { return messageSource; @@ -157,7 +158,8 @@ else if (sftpSupplierProperties.getFilenameRegex() != null) { /* * Create a Flux from a MessageSource that will be used by the supplier. */ - private Flux> sftpMessageFlux(MessageSource sftpMessageSource, + private Flux> sftpMessageFlux( + @Qualifier("sftpMessageSource") MessageSource sftpMessageSource, SftpSupplierProperties sftpSupplierProperties) { return IntegrationReactiveUtils.messageSourceToFlux(sftpMessageSource) @@ -201,7 +203,7 @@ SftpStreamingInboundChannelAdapterSpec targetMessageSource(SftpRemoteFileTemplat } @Bean - Publisher> sftpReadingFlow(MessageSource sftpMessageSource, + Publisher> sftpReadingFlow(@Qualifier("sftpMessageSource") MessageSource sftpMessageSource, SftpSupplierProperties sftpSupplierProperties, FileConsumerProperties fileConsumerProperties) { return FileUtils @@ -247,7 +249,7 @@ static class NonStreamingConfiguration { */ @Bean @ConditionalOnExpression("environment['file.consumer.mode']!='ref' && environment['sftp.supplier.list-only']!='true'") - Publisher> sftpReadingFlow(MessageSource sftpMessageSource, + Publisher> sftpReadingFlow(@Qualifier("sftpMessageSource") MessageSource sftpMessageSource, SftpSupplierProperties sftpSupplierProperties, FileConsumerProperties fileConsumerProperties, @Nullable @Qualifier("renameRemoteFileHandler") MessageHandler renameRemoteFileHandler) {