1 回答
- 最新
- 投票最多
- 评论最多
0
Hello Phoenix2819,
I think you are missing step 8 and 9 described in the AWS blog here - Managing sessions of anonymous users in WebSocket API-based applications
The sample code is provided in the blog link above which uses EventBridge to schedule OnDelete function execution every 5 minutes.
Step 8 - If the connection breaks, the WebSocket API calls the OnDisconnect Lambda function automatically. The function marks the connection ID for the given user ID as inactive.
Step 9 - If the user does not return within 5 minutes, Amazon EventBridge scheduler invokes the OnDelete Lambda function, which deletes items with more than 5 minutes of inactivity from Connections and Sessions tables.
已回答 7 个月前
相关内容
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前