Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 119 discussion

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

  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
MrTee
Highly Voted 1 year, 4 months ago
Selected Answer: 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.
upvoted 20 times
akmv2
5 months, 3 weeks ago
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
upvoted 1 times
...
...
catcatpunch
Highly Voted 1 year, 3 months ago
Selected Answer: 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
upvoted 10 times
...
Saurabh04
Most Recent 1 month, 1 week ago
Option DE: Implement $connect and $disconnect Routes: Add $connect and $disconnect routes to your WebSocket API. These routes handle client connections and disconnections. When a client connects ($connect), a Lambda function can add the connection ID to a data store (e.g., DynamoDB). When a client disconnects ($disconnect), another Lambda function can remove the connection ID from the data store. Track Client Status: Use Amazon ElastiCache (e.g., Redis) to track client status. Store relevant information (e.g., client IDs, connection timestamps) in ElastiCache. This allows you to identify clients that connect and disconnect
upvoted 1 times
...
tomchandler077
2 months ago
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.
upvoted 1 times
...
tsangckl
3 months ago
This appear at 17 Jun exam
upvoted 2 times
frangesk
3 weeks, 1 day ago
Do you remember the answers?
upvoted 1 times
...
...
65703c1
3 months, 3 weeks ago
Selected Answer: DE
DE is the correct answer.
upvoted 1 times
...
41eb566
6 months ago
Selected Answer: 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.
upvoted 1 times
...
maurice2005
6 months ago
Selected Answer: 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
upvoted 1 times
...
SerialiDr
6 months, 2 weeks ago
Selected Answer: 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).
upvoted 2 times
...
KarBiswa
6 months, 3 weeks ago
Selected Answer: 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
upvoted 1 times
...
Ashwinvdm22
7 months, 2 weeks ago
Selected Answer: 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.
upvoted 2 times
...
Abdullah22
7 months, 4 weeks ago
going with DE
upvoted 1 times
...
SerialiDr
8 months ago
Selected Answer: 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.
upvoted 1 times
...
a_win
8 months, 3 weeks ago
Selected Answer: 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.
upvoted 1 times
...
LR2023
9 months, 2 weeks ago
Selected Answer: CE
https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html
upvoted 1 times
...
Balliache520505
1 year ago
Selected Answer: 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
upvoted 2 times
...
love777
1 year ago
Selected Answer: 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.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...