-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically change the input directory for inbound channel adapter [INT-4025] #7971
Comments
Artem Bilan commented I would to know more background.
The The With that you can inject it now to any service which may change the directory according any conditions. On the other hand you can inject the So, having all that in hands, I'm not sure what you would like to introduce here. |
Gary Russell commented This is similar to #7713; yes, it can be done in a smart poller, but adding expression support would be more convenient. Obviously, it would not be compatible with the |
Varun Maurya commented inbound channel adapter is starting point of my application. The way you suggest to have access of FileReadingMessageSource and setting the directory would change after first run.i.e. after adapter is created with some static directory location with some file. How can i change it even before that so that i could directly get the access to required folder. |
Artem Bilan commented For the But yes, we definitely may implement it like Gary suggest, via |
Varun Maurya commented I am sorry if i am not able to understand you correctly or i am not able to explain the problem - Let me try one more time : the inbound channel adapter with poller is entry-point for my application. when i load my config(through war) the poller starts polling the directory mentioned in "inbound channel adapter" but i want to change that directory everytime poller start to poll directory, based on my criteiria. |
Gary Russell commented You can update the source on each poll using a smart poller
but I think it's a reasonable enhancement to align it with the remote file (S)FTP adapters and add |
Artem Bilan commented You can configure your adapter with some fake dir from the beginning and
you can achieve with the public class ChangeDirAdvice implements MethodInterceptor {
@Autowired
@Qualifier("myFileReadingAdapter.source")
private FileReadingMessageSource fileReadingMessageSource;
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
File newDirectory = ...;
this.fileReadingMessageSource.setDirectory(newDirectory);
return invocation.proceed();
}
} for the |
Gary Russell commented Also see "Smart" Polling. |
Varun Maurya opened INT-4025 and commented
Today, when we use a "file:inbound-channel-adapter" the directory it looks into is fixed. Can we add a feature handle of adapter so that we could inject the input directory dynamically.
Reference URL: http://stackoverflow.com/questions/37142937/how-to-assign-dynamic-values-to-directory-in-inbound-file-adapter-spring-integr
Issue Links:
The text was updated successfully, but these errors were encountered: