I have a Spring Batch application which does followings,
Spring Batch Application Tech Stack
Created using Spring Boot
Spring Batch Job Launcher is called upon a REST endpoint
Deployed in OpenShift
What I want to do,
When the other application puts a new file into the S3 INBOUND bucket it needs to trigger the Spring Batch Operation (call the REST endpoint which launches the job)
Can I do this using a K8s Cron Job which triggered by S3 events? If so can someone please explain how? Or do I have any other options?
I am not too familiar with AWS services but I know that they provide a notification service for S3 buckets: https://docs.aws.amazon.com/AmazonS3/latest/user-guide/enable-event-notifications.html
One of the event notification destinations is AWS Lambda. So you can try to create a function that calls the rest endpoint and which is triggered when a notification of type ObjectCreated
arrives.
My solution was to create a lambda function which is triggered when a .txt file is uploaded into the S3 bucket's INBOUND folder.
Wrote a python handler to curl command to hit the job launcher REST end point.