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

1 Resposta
0
Resposta aceita

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 :-)

respondido há 3 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas