These are two ways I can think of:
a. Pass each stream through the header, add a custom header that tells you which directory you started from, and then with the input channel.
<file:inbound-channel-adapter id="fileInOne" directory="myDirOne" auto-create-directory="true" channel = "dirOneEnricher"> <int:poller id="one" cron="1/10 * * * * *"/> </file:inbound-channel-adapter> <int:header-enricher input-channel="dirOneEnricher" output-channel="inputChannel"> <int:header name="fileCategory" value="dirOneTypeCategory"/> </int:header-enricher>
..
b. Since the payload is java.io.File , you can use the API to find out which directory this file belongs to and take some action.
source share