Skip to content

Commit

Permalink
GH-117: Fix auto-wire ambiguity in the FileSupplierConfiguration
Browse files Browse the repository at this point in the history
Fixes: #117

* Use `fileReadingMessageSource` bean name as it is expected by the injection point.
* Fix `DefaultFileSupplierTests` for a new `fileReadingMessageSource` bean name
  • Loading branch information
artembilan committed Dec 19, 2024
1 parent 4024f19 commit 9bc93a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -123,7 +121,7 @@ protected static class FileMessageSourceConfiguration {
}

@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
Expand All @@ -141,7 +139,7 @@ else if (this.fileSupplierProperties.getFilenameRegex() != null) {
return chainFilter;
}

@Bean
@Bean("fileReadingMessageSource")
public FileInboundChannelAdapterSpec fileMessageSource(FileListFilter<File> fileListFilter,
@Nullable ComponentCustomizer<FileInboundChannelAdapterSpec> fileInboundChannelAdapterSpecCustomizer) {

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -47,7 +47,7 @@
public class DefaultFileSupplierTests extends AbstractFileSupplierTests {

@Autowired
@Qualifier("fileMessageSource")
@Qualifier("fileReadingMessageSource")
private FileReadingMessageSource fileMessageSource;

@Autowired
Expand Down

0 comments on commit 9bc93a9

Please sign in to comment.