I’m using SQS and NodeJS lambda (as SQS Event handler) for creating/updating events in Google Calendar.
The code is similar to this
...
export const handler = async (event) => {
const schemaEvent = getDataFromEvent(event)
console.log('schemaEvent', schemaEvent)
const { data } = await calendar.events.insert({
calendarId: CALENDAR_ID,
requestBody: schemaEvent,
sendUpdates: 'all',
})
console.log('data', data)
}
...
When SQS receives many events (for ex.: 30), for some of events i can’t see last console.log('Data', data)
and code after that doesn’t execute. But, if concurrency is set to 1 it works as expected.
What a reason of the problem can be?
Note:
BatchSize = 1
for handler- SQS type is
FIFO
- Dedupe is disabled
Logs ( RequestId: e1c8a24b-8052-544e-8e44-f868b56273d5
wasn’t processed till the end):
2021-12-02T22:56:15.211+02:00 START RequestId: 75dff3c9-26d5-5087-9110-a9ea13fba018 Version: $LATEST
2021-12-02T22:56:15.317+02:00 2021-12-02T20:56:15.299Z 75dff3c9-26d5-5087-9110-a9ea13fba018 INFO schemaEvent {... some data}
2021-12-02T22:56:16.176+02:00 2021-12-02T20:56:16.176Z 75dff3c9-26d5-5087-9110-a9ea13fba018 INFO data { ...some data }
2021-12-02T22:56:16.238+02:00 END RequestId: 75dff3c9-26d5-5087-9110-a9ea13fba018
2021-12-02T22:56:16.238+02:00 REPORT RequestId: 75dff3c9-26d5-5087-9110-a9ea13fba018 Duration: 1712.34 ms Billed Duration: 1713 ms Memory Size: 256 MB Max Memory Used: 164 MB
2021-12-02T22:56:16.512+02:00 START RequestId: e1c8a24b-8052-544e-8e44-f868b56273d5 Version: $LATEST
2021-12-02T22:56:16.717+02:00 2021-12-02T20:56:16.700Z e1c8a24b-8052-544e-8e44-f868b56273d5 INFO schemaEvent {...some data}
2021-12-02T22:56:18.225+02:00 END RequestId: e1c8a24b-8052-544e-8e44-f868b56273d5
2021-12-02T22:56:18.225+02:00 REPORT RequestId: e1c8a24b-8052-544e-8e44-f868b56273d5 Duration: 1710.32 ms Billed Duration: 1711 ms Memory Size: 256 MB Max Memory Used: 164 MB
...