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

206
Vistas
How to prevent AWS Lambda from deleting message from SQS queue

I have a Lambda function, which will be sending SNS notification when a message is sent to SQS Queue. But i observe that Lambda will delete the message from queue once it has processed it and its been mentioned here

Is there a way i can make the lambda fail, without actually throwing a new Exception in java.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

From you description, it seems that you should consider using fan-out scenario for your use-case:

The "fanout" scenario is when an Amazon SNS message is sent to a topic and then replicated and pushed to multiple Amazon SQS queues, HTTP endpoints, or email addresses.

enter image description here

In this scenario, your SNS would publish a message to two SQS queues. Subsequently, each team would have its own messages to work, and you wouldn't need to forcefully terminate your lambda to keep a processed message in a single queue.

over 4 years ago · Santiago Trujillo Denunciar

0

By default, SQS to Lambda integration means that messages in que will become invisible once the function begins processing it, and will be deleted from the que once the function has completed.

If the function fails (bad exit), then the message will go back to 'visible', and will be processed once again by a new lambda invocation. This will go-on until whatever is configured in your re-drive policy.

In any case, after about 4 days, messages will start to be purged off the que, the SQS que is not a permanent storage place. You cannot use SQS as permanent storage.

A short answer to your question is to fail the invocation by exiting with a non-zero status -- but beware, the message will be reprocessed, unless you have a redrive policy that will push it into the DLQ.

over 4 years ago · Santiago Trujillo 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