skip to Main Content

I have an SQS queue with a supported DLQ for failures. I want to write a custom Lambda function in java (spring boot) to get the messages from this dlq, write it to a file, upload the file to an S3 bucket and send the file as an alert to a specified webhook.

I’m new to lambda and I hope this design can be implemented.

One requirement is that I want to execute the Lambda only once per day. So let’s say at 6:00 am everyday. I want all the messages in the queue to be written to a file.

I’m trying to see examples of RequestHandler being implemented where the messages in the queue are received and iterated to be saved in the file one at a time.

I’m not sure how to configure the lambda such that it runs only once per day instead of each time a message entering the DLQ.

Any documentation relating to these queries will be really helpful. Please critique my expected implementation and offer any better solutions for the same.

2

Answers


  1. You can have your lambda code run on any schedule (once per day for your case) using CloudWatch Event Schedule.

    To create the schedule, follow this link

    In you lambda code, you can fetch the messages from DLQ and process them iteratively.

    Login or Signup to reply.
    1. You no need to use Spring framework in AWS Lambda use Java only
    2. Use Lambda with Cloud watch cron expression and schedule daily run.
    3. Write your own logic
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search