Reputation: 910
For a spring-integration project, say I have a config file with different sets of FTP configuration values. Each set will need to be turned into a MessageSource for the application to all poll from the various FTP sources and insert them into a specific, single channel.
How do I iterate through each configuration set to dynamically create the multiple MessageSources on startup and add them to an IntegrationFlow? This config file can grow/shrink at any time. Updating the project code dropping in a new @Bean object and going through a production deployment each time the config file is updated is definitely not ideal.
I'll need to basically create a set of MessageSources then iterate through the created MessageSources adding them all to an IntegrationFlow during startup.
Note: The adding and removing of the MessageSources doesn't need to be 'on-the-fly', just pick up the new configuration values on the application startup.
Upvotes: 1
Views: 797
Reputation: 121282
Starting with Spring Integration Java DSL 1.2
, there is a manual IntegrationFlow
registration functionality. So, you have to iterate your configuration, create IntegrationFlow
definitions and call integrationFlowContext.registration(myFlow)
for each of them.
Upvotes: 1