Is there any kind of callback or event the lambda function can receive just before the runtime is frozen/shutdown?

0

I am running java based lambda function and using java, it is triggered by apigw and it uses AmazonSQSAsync client for sending msg to sqs asynchronously using sendMessageAsync() call. The concern is that, after the handleRequest() method returns the response, will the jvm / runtime environment immediately be frozen for later reuse? if yes, what happens to msg in flight as the call to sqs is async? Is there any kind of callback or event the lambda function can receive just before the runtime is frozen/shutdown? I don’t think so based on the lambda docs but wanted to check if anyone knows of any workaround for that.

1 Answer
0

I would suggest to visit https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html which talks about Lambda freezes the execution environment when the runtime and each extension have completed and there are no pending events.

profile pictureAWS
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions