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:
Artem Bilan
2024-12-19 13:32:05 -05:00
parent 4024f19119
commit 9bc93a9371
2 changed files with 4 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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