0

Using spring integration, I want to pickup only the files based from the filename specified by a trigger file.

E.g. batch01.tar will be picked up if .batch01-trigger is present then update the filename of the trigger depending on the processing outcome (.batch01-trigger.success or .batch01-trigger.failed)

I am polling S3 bucket at the moment but I couldn't apply the above use case.

Thanks!

I used AWS SDK and spring-integration-aws.

1 Answers1

0

I can see a solution like this:

  1. Have an S3InboundFileSynchronizingMessageSource configured for the *-trigger pattern. So, it is going to poll S3 directory periodically for presence of the files like yours .batch01-trigger.

  2. You send this file downstream to some service activator which would use an S3Session.list() and filter out only matching files. Or public InputStream readRaw(String source) { since you know at this point the file name (batch01.tar) you need to pull from an S3.

  3. The trigger file you store in the message headers at this point.

  4. After processing .tar file you make a .success or .failed decision and perform S3Session.rename().

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118