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? (Select TWO.)
Requirement Summary:
WebSocket-based messaging app using API Gateway WebSocket APIs
Need to:
Identify clients repeatedly connecting/disconnecting
Be able to remove problematic clients
Evaluate Options:
A . Switch to HTTP APIs
HTTP APIs don't support WebSocket connections
B . Switch to REST APIs
REST APIs are not compatible with WebSockets
C . Use the callback URL to disconnect clients
Possible, but not a direct option
Callback URLs are used for sending messages to connected clients, not for disconnecting
D . Track client status in ElastiCache
Good solution: Store and update connection state (connected, disconnected, timestamps)
Helps track abuse or reconnections
E . Implement $connect and $disconnect routes
Required to capture connection lifecycle events
These can be used to log/store client behavior and decide on removal
WebSocket routes in API Gateway: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-route-selection.html
Managing WebSocket connections: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-mapping-template-reference.html
Currently there are no comments in this discussion, be the first to comment!