GH-117: Fix auto-wire ambiguity in the FileSupplierConfiguration
Fixes: https://github.com/spring-cloud/spring-functions-catalog/issues/117 * Use `fileReadingMessageSource` bean name as it is expected by the injection point. * Fix `DefaultFileSupplierTests` for a new `fileReadingMessageSource` bean name
This commit is contained in:
@@ -67,8 +67,6 @@ public class FileSupplierConfiguration {
|
||||
public Publisher<Message<String>> fileTailingFlow(FileSupplierProperties fileSupplierProperties) {
|
||||
FileSupplierProperties.Tailer tail = fileSupplierProperties.getTailer();
|
||||
TailAdapterSpec tailAdapterSpec = Files.tailAdapter(fileSupplierProperties.getTail())
|
||||
// TODO until Spring Integration 6.2.3
|
||||
.autoStartup(false)
|
||||
.fileDelay(tail.getAttemptsDelay().toMillis())
|
||||
// OS native tail command
|
||||
.nativeOptions(tail.getNativeOptions())
|
||||
@@ -123,7 +121,7 @@ public class FileSupplierConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ChainFileListFilter<File> filter(ConcurrentMetadataStore metadataStore) {
|
||||
public ChainFileListFilter<File> fileListFilter(ConcurrentMetadataStore metadataStore) {
|
||||
ChainFileListFilter<File> chainFilter = new ChainFileListFilter<>();
|
||||
if (StringUtils.hasText(this.fileSupplierProperties.getFilenamePattern())) {
|
||||
chainFilter
|
||||
@@ -141,7 +139,7 @@ public class FileSupplierConfiguration {
|
||||
return chainFilter;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Bean("fileReadingMessageSource")
|
||||
public FileInboundChannelAdapterSpec fileMessageSource(FileListFilter<File> fileListFilter,
|
||||
@Nullable ComponentCustomizer<FileInboundChannelAdapterSpec> fileInboundChannelAdapterSpecCustomizer) {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020-2022 the original author or authors.
|
||||
* Copyright 2020-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
public class DefaultFileSupplierTests extends AbstractFileSupplierTests {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("fileMessageSource")
|
||||
@Qualifier("fileReadingMessageSource")
|
||||
private FileReadingMessageSource fileMessageSource;
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user