exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

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: DE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
MrTee
Highly Voted 1 year, 9 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 22 times
akmv2
10 months, 2 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, 8 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
...
mooncake1
Most Recent 1 week, 4 days ago
Selected Answer: CE
DE does not make the developer disconnect
upvoted 1 times
mooncake1
1 week, 4 days ago
Can't believe DE is 50%.. this q is not even hard
upvoted 1 times
...
...
Arad
1 month ago
Selected Answer: CE
CE is correct.
upvoted 1 times
...
sumanshu
1 month, 1 week ago
Selected Answer: DE
A) Eliminated - Switching to HTTP APIs would eliminate the WebSocket capability entirely, B) Eliminated - REST APIs are also unsuitable for WebSocket connections, as they are designed for request-response interactions rather than persistent, real-time communication. Both C&E and D&E - seems correct C) - API Gateway provides a callback URL that your backend service can use to invoke the POST /connections/{connectionId} API with the disconnect command. D) E) Correct - The $connect route triggers when a client establishes a WebSocket connection. The $disconnect route triggers when a client disconnects from the WebSocket
upvoted 1 times
sumanshu
1 month, 1 week ago
C) Callback URL allows you to explicitly disconnect clients.
upvoted 1 times
sumanshu
1 month, 1 week ago
The two requirements in the question are: Identify a client that keeps connecting and disconnecting: This requires tracking client connections and disconnections over time. To achieve this, the backend needs a mechanism to log or store connection events for each client, which can then be analyzed to identify repeated connection patterns. Remove the client: Once the client is identified as problematic (e.g., frequent connects/disconnects), the backend needs to remove the client. This is achieved using the WebSocket callback URL to explicitly disconnect the client.
upvoted 1 times
sumanshu
1 month, 1 week ago
D is critical for tracking client activity. E is required to capture connection and disconnection events. C provides the functionality to disconnect a client once identified. Thus, the correct combination is C, D, and E.
upvoted 1 times
sumanshu
1 month, 1 week ago
C. Use the callback URL to disconnect the client from the backend service This is essential for removing the client. Without it, the backend has no way to forcibly disconnect a problematic client. ✅ Must-have. D. Add code to track the client status in Amazon ElastiCache in the backend service Tracking client connection/disconnection behavior is critical to identifying problematic clients. ElastiCache is a highly suitable tool for storing connection data efficiently. ✅ Must-have. E. Implement $connect and $disconnect routes in the backend service While these routes are necessary for detecting client connections and disconnections, this could be seen as implicit in the implementation of D (since tracking client status assumes these routes are already used). ⚠️ Optional, depending on how the question is interpreted.
upvoted 1 times
...
...
...
...
...
Saurabh04
6 months 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
9d8dd9c
3 months, 1 week ago
What about "the ability to remove the client"? for that it needs to use the callback function
upvoted 1 times
...
...
tomchandler077
6 months, 3 weeks 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
7 months, 3 weeks ago
This appear at 17 Jun exam
upvoted 2 times
frangesk
5 months, 2 weeks ago
Do you remember the answers?
upvoted 1 times
...
...
65703c1
8 months, 2 weeks ago
Selected Answer: DE
DE is the correct answer.
upvoted 1 times
...
41eb566
10 months, 3 weeks 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
10 months, 3 weeks 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
11 months, 1 week 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
11 months, 2 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
1 year 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
1 year ago
going with DE
upvoted 1 times
...
SerialiDr
1 year 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
1 year, 1 month 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
...
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago