Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

146
Vistas
Lambda function as SQS Event handler doesn't run a part of code and finishing successfully

I'm using SQS and NodeJS lambda (as SQS Event handler) for creating/updating events in Google Calendar.
The code is similar to this

const { google } = require('googleapis')

google.options({
  http2: true,
})
...
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
...
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In my case the problem was in googleapi, solved by removing config options:

google.options({
  http2: true,
})
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda