batch window lower than 20s but lambda function is called in 20s interval

0

In lambda manual, there is:

If you're using a batch window and your SQS queue contains very low traffic, Lambda might wait for up to 20 seconds before invoking your function. This is true even if you set a batch window lower than 20 seconds.

What is the cause behind this? I asked chatGPT and Bard, but neither of them could give me a solid answer.

  • How is your visibility timeout configured?

  • It's 30 seconds by default

demandé il y a 3 mois155 vues
1 réponse
0
Réponse acceptée

I think I get the root cause. Lambda is using long polling to get messages from SQS. it will wait for the message for up to 20 seconds. So even if there is no message during that time and a shorter batch window like 2 seconds has been set, the function will be invoked after 20 seconds with an empty message.

I will vote myself :-)

répondu il y a 3 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions