AWS Certified Developer – Associate (DVA-C02) — Question 93
A real-time messaging application uses Amazon API Gateway WebSocket APIs with backend HTTP service. A developer needs to build a feature in the application to identify a client that keeps connecting to and disconnecting from the WebSocket connection. The developer also needs the ability to remove the client.
Which combination of changes should the developer make to the application to meet these requirements? (Choose two.)
Answer options
- A. Switch to HTTP APIs in the backend service.
- B. Switch to REST APIs in the backend service.
- C. Use the callback URL to disconnect the client from the backend service.
- D. Add code to track the client status in Amazon ElastiCache in the backend service.
- E. Implement $connect and $disconnect routes in the backend service.
Correct answer: D, E
Explanation
The correct answers, D and E, are necessary for tracking client connections and managing their status. Implementing the $connect and $disconnect routes allows the application to handle client connections appropriately, while using Amazon ElastiCache to track client status provides a fast, in-memory solution. Options A and B are not suitable as they do not utilize WebSocket functionality, and option C does not provide a method for tracking the client status.