1
votes

I have a spring-integration channel hooked up to a service-activator using the XML configuration. I've attached an sftp inbound-channel-adapter to the same channel. This is working quite well.

I would like to allow my clients to add/remove SFTP inbound-channel-adapters to the channel through my web interface, but instantiating spring-integration components appears to be fairly tightly coupled to the XML Spring context (see org.springframework.integration.sftp.config.SftpInboundChannelAdapterParser).

Is there a way to add/remove SFTP inbound-channel-adapters after the application has started?

1

1 Answers

2
votes

This is not trivial task. All Spring Integration components are Spring beans, at least. So, if you want to do something with Spring at runtime you should Application Context, who provides Dependency Injection features. I suggest to take a look into this sample: https://github.com/spring-projects/spring-integration-samples/tree/master/advanced/dynamic-ftp It demonstrates some dynamic registration technique.