Are API Gateway Websocket APIs treated as asynchronous?

0

Hi,

I'm looking at setting up a Websocket API, with a Lambda as the message handler.

If my Lambda can't scale up quick enough, what happens? Will the messages be retried by API Gateway? Will the client think the message worked, or will they get an error? And if retries happen, how many - is there any possibility the message will get lost and I won't know about it?

Thanks for the help. Excited to try this!

2개 답변
1

Unless you configure the route as two-way, client to WebSocket API is one-way. In the case, when Lambda invocation is failed, the client will not receive anything. If you configure the route as two-way, the client will receive the error response.
Alternatively, you could configure the route one-way and make your Lambda to send ACK message to the client. In this case, you need to handle when the client doesn't receive the ACK in a given amount of time.

API Gateway doesn't retry for the message. You may use SQS for the better reliability and re-drive the message.
Client - API Gateway - SQS - Lambda

But still client-side retry is also recommended since API Gateway to SQS can be failed as well.

AWS
답변함 4년 전
0

Thanks for the reply! It's good to know that we only get one try at sending the message.

답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠