Exam DVA-C02 All QuestionsBrowse all questions from this exam
Question 119

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.)

    Correct Answer: D, E

    To fulfill the requirements, the developer should: 1) Add code to track the client status in Amazon ElastiCache because it provides a fast, in-memory data store that allows the backend service to quickly access and update client status data. This information is crucial for identifying clients with erratic connection patterns. 2) Implement $connect and $disconnect routes because these routes are triggered automatically by API Gateway whenever a client connects or disconnects. This allows the backend service to track and manage client connections and disconnections efficiently.

Discussion
MrTeeOptions: DE

Option D because by storing the client status in the cache, the backend service can quickly access the client status data without the need to query the database or perform other time-consuming operations. Option E. Implement $connect and $disconnect routes in the backend service: $connect and $disconnect are the reserved routes in WebSocket APIs, which are automatically called by API Gateway whenever a client connects or disconnects from the WebSocket. By implementing these routes in the backend service, the developer can track and manage the client status, including identifying and removing the client when needed.

akmv2

How is D viable when the question doesn't mention Elasticache? You're making an assumption that adding a service/configuration is what's being asked

catcatpunchOptions: CE

C => https://docs.aws.amazon.com/ko_kr/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html E => https://docs.aws.amazon.com/ko_kr/apigateway/latest/developerguide/apigateway-websocket-api-route-keys-connect-disconnect.html

PhongsanthOptions: CE

Option C and E is my preferable choice. why do we have to use option D in case we apply $connect and $disconnect already in option E ? https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-route-keys-connect-disconnect.html

love777Options: DE

D. Tracking Client Status: To identify and manage clients that connect and disconnect from the WebSocket connection, you need a way to persist this information. Amazon ElastiCache is a managed in-memory caching service that can be used to store this kind of data. By adding code to your backend service to track client status in ElastiCache, you can keep a record of client connections and disconnections. E. connectanddisconnect Routes: In API Gateway WebSocket APIs, the connectanddisconnect routes are special routes that are automatically triggered when a client connects and disconnects from the WebSocket connection. By implementing these routes in your backend service, you can capture the client information and update the client status in the ElastiCache, thus achieving the requirement of identifying clients and managing their connections.

SerialiDrOptions: DE

When a client connects to your WebSocket API, the $connect route is invoked, and when they disconnect, the $disconnect route is invoked. You can use these routes to track the state of each client. By maintaining a record of each client's connections and disconnections, possibly in a database or an in-memory data store like Amazon ElastiCache, you can identify clients that frequently connect and disconnect. Hence, the combination of changes that should be made to the application to meet these requirements includes: Implement $connect and $disconnect routes in the backend service (Option E). Add code to track the client status in Amazon ElastiCache in the backend service (Option D).

Ashwinvdm22Options: CD

C: https://docs.aws.amazon.com/ko_kr/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html D: You need a way to track which user is continuously reconnecting. That is why option D is so important because without it you will just be disconnecting every user that tries to connect cause then how will you know which user is the "problem" user. Note that you don't need the $disconnect endpoint to disconnect a client if you use option C. So CD is the only combination to solve the problem.

Balliache520505Options: CE

I go with C and E. https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-route-keys-connect-disconnect.html https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html

tomchandler077

Option D ---> CORRECT Because, tracking the client's connection status using ElastiCache could help in identifying clients with erratic connection patterns and managing stateful information in a distributed environment, which is useful for WebSocket applications. Also Option E CORRECT. These routes handle connection and disconnection events.

tsangckl

This appear at 17 Jun exam

65703c1Options: DE

DE is the correct answer.

41eb566Options: DE

E. Implement $connect and $disconnect routes in the backend service. By implementing $connect and $disconnect routes, the backend service can capture when clients connect and disconnect from the WebSocket connection. This allows the application to track client status effectively. D. Add code to track the client status in Amazon ElastiCache in the backend service.

maurice2005Options: CE

Your backend service can use the following WebSocket connection HTTP requests to send a callback message to a connected client, get connection information, or disconnect the client https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html

KarBiswaOptions: CE

C option - Supports https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html E option supports - https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-route-keys-connect-disconnect.html

Abdullah22

going with DE

SerialiDrOptions: CD

C. Use the callback URL to disconnect the client from the backend service: The callback URL can be used to send messages to connected clients or to disconnect them from the WebSocket connection. This approach allows the backend service to programmatically disconnect a client, which is useful for managing clients that frequently connect and disconnect. D. Add code to track the client status in Amazon ElastiCache in the backend service: Implementing client status tracking in the backend service, possibly using a fast, in-memory data store like Amazon ElastiCache, allows the application to monitor and record the behavior of each client. This can be used to identify clients with frequent connect/disconnect patterns.

a_winOptions: DE

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.

LR2023Options: CE

https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html