1 Answer
- Newest
- Most votes
- Most comments
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.
answered 7 months ago
Relevant content
- asked 10 months ago
- asked 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago