maintaining a live WebSocket connection in AWS Lambda for two-way communication

0

Hello,

I hope you are all doing well. Currently, I am working with the Amazon Connect Chat API to build a Facebook connector. The purpose is to receive messages from Facebook on behalf of our agents. The process involves calling the CreateParticipantConnection API, which returns a WebSocket URL. Subsequently, I create a WebSocket connection using the "ws" module in Node.js.

However, there is an issue with the Lambda execution. After calling the APIs and establishing the WebSocket connection, the Lambda execution completes, and the WebSocket connection is closed. To facilitate two-way communication, I need to keep the WebSocket URL live.

I would like to know if this approach is correct for the task at hand. If it is, I need guidance on how to maintain a live WebSocket connection in the Lambda environment for seamless two-way communication.

Any assistance and advice on this matter would be greatly appreciated.

Thank you,

1개 답변
0
수락된 답변

Given the nature of Lambda - mostly that functions have a maximum runtime of 15 minutes - I'd suggest that it isn't the right service for what you're trying to do.

Instead, I'd suggest looking at Fargate for this instead.

profile pictureAWS
전문가
답변함 10달 전
profile picture
전문가
검토됨 10달 전
profile picture
전문가
검토됨 10달 전

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

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

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

관련 콘텐츠