1 Risposta
- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
1
You can consider using the following design patterns:
- Use AWS Integration target for API Gateway, so that it will send messages directly to an SQS queue and have Lambda function to be triggered from that queue for message processing. See Amazon API Gateway to SQS to Lambda pattern, for example.
- You can leverage Lambda Asynchronous invocation capability with API Gateway's Lambda Integration as described here: Set up asynchronous invocation of the backend Lambda function.
The difference between option 1 and 2 is that SQS queue for the option 2 is managed internally by Lambda runtime and you have less control over its configuration.
That way, API Gateway will respond to the caller without waiting for Lambda to complete its execution.
con risposta 2 anni fa
Contenuto pertinente
- AWS UFFICIALEAggiornata 3 anni fa
- AWS UFFICIALEAggiornata 2 anni fa
#1 is the path I ended up going with. Setting up an API that receives a post request to a "/events" endpoint and a simple proxy to handle events that do not match a pattern for the API. Lambda setup to trigger off the SQS and any failed or stale messages are pushed to a Dead Letter Que for further handling / reporting.
Setup this way I get proper response times when handling webhook responses while still giving the longer running lambdas time to process.