Is there a way to register IntegrationFlow for multi-tenancy. Assuming requirement is to process PF for few tenants such as INFY, TCS, WIPRO etc. Every tenant has it’s own directory path with the same pattern like /mount/batches/{tenantId}/pf
.
Every tenant owns it's own folder as follows:
INFY –> /mount/batches/INFY/pf
TCS –> /mount/batches/TCS/pf
WIPRO –> /mount/batches/WIPRO/pf
InboundFlow accepting only one source directory and other answers in stackoverflow suggesting to have a separate InboundFlow definition for each folder, but we have almost 100 tenants to configure and for every new tenant we need to have code changes in such case.
Please suggest me, if there any way we can write an adaptor to watch multiple folders at once.
You can programmatically create multiple inbound adapters that send to the same channel.
See the documeentation.
With FTP/SFTP you can rotate between different servers and remote folders
There is currently no equivalent for mounted folders.
However, you could configure a custom DirectoryScanner
that rotates between different folders by delegating to a list of scanners.