How to Implement a Stateless Timer to Auto-Remove Inactive Conversations in an AWS-Based Chat Application?

0

I am developing a real-time chat application using AWS Streaming APIs, Amazon Lex, Amazon Connect, etc. I need a functionality where if a customer does not reply within a specific time frame, their conversation is automatically removed. I want to implement a stateless timer to track messages, which will reset if the customer replies within the time frame. If the customer does not reply, the timer should trigger an event to remove the chat. How can I achieve this using a solution that does not depend on my application code?

2 Answers
0

Use EventBridge Scheduler to create a schedule whenever a message is sent. When the user replies, you need to delete that timer. When it fires, it can invoke a Lambda function that removes the conversation.

profile pictureAWS
EXPERT
Uri
answered 15 days ago
0

This can be implemented using the built-in timers and Idle participant functionality provided by Amazon Connect Chat.

Refer:

  1. https://docs.aws.amazon.com/connect/latest/adminguide/setup-chat-timeouts.html OR

  2. using ChatJS library chatSession.onParticipantIdle() => https://github.com/amazon-connect/amazon-connect-chatjs?tab=readme-ov-file#chatsessiononparticipantidle chatSession.onParticipantReturned() => https://github.com/amazon-connect/amazon-connect-chatjs?tab=readme-ov-file#chatsessiononparticipantreturned chatSession.onAutoDisconnection() => https://github.com/amazon-connect/amazon-connect-chatjs?tab=readme-ov-file#chatsessiononautodisconnection

AWS
Vikas P
answered 15 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions