cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Hot folder priority import

Former Member
0 Likes
451

I have a specific requirement where whenever a specific priority files comes into hot folder, this file should be picked up first before processing any of the file which are already in sequence , fileOrderCompartor can't help me. Any other way around this.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

Hi,

If you are using spring integration to poll the folder, it is possible to set a file name pattern for the inbound channel adapter. (or use separate folders like explained in previous comment)

 <int-file:inbound-channel-adapter id="filesIn" directory="file:${input.directory}"
     filename-regex="test[0-9]+\.txt" />

You would then need to wait for both documents before processing and then process them in order. This can be achieved by events or by object state.

Documentation for spring integration file support here: https://docs.spring.io/spring-integration/reference/html/files.html

VinayKumarS
Active Contributor
0 Likes

Better you create a two hot folders. one hot folder polling for every minute and another hot folder for every 5 minutes. instead of writing business logic to compare with fileOrderComparator.