Salesforce Certified Platform Developer II free question 10 / 10 · Domain 5: Performance
A Visualforce page used by thousands of agents has a button that queries an external warranty service. The service takes a long time to respond, and at busy times the button's processing fails. Which benefit of asynchronous callouts (continuations) does the documentation give?
- The external service's response itself becomes faster and the waiting time shrinks
- Requests can run without being subject to the limit of concurrent long-running requests (10)
- The external service can be called without adding it to Remote Site Settings
- The user can move on to the next action on the page right away without waiting for the response
Show the answer and explanation
Answer: B
Why this is correct
The "Make Long-Running Callouts with Continuations" page describes a Visualforce page that gets warranty information from a Web service, which thousands of agents in the organization can use, so that a hundred of them can click the same button at the same time. These hundred simultaneous actions exceed the limit of concurrent long-running requests of 10. But by using asynchronous callouts, the requests aren't subjected to this limit and can be executed.
Why the other options are wrong
"The external service's response itself becomes faster and the waiting time shrinks" … The page says that after the request is sent to the service, the Visualforce request is suspended. A continuation doesn't make the external service respond faster.
"The user can move on to the next action on the page right away without waiting for the response" … The page says the user must wait for the response to be returned before proceeding with using the page and invoking new actions.
"The external service can be called without adding it to Remote Site Settings" … The page says that before you can call an external service, you must add the remote site to a list of authorized remote sites. A named credential is the alternative the page gives, not the use of a continuation.
Execution flow
The app server hands the callout request to the Continuation server before returning to the Visualforce page. The Continuation server sends the request to the Web service, receives the response, and hands it back to the app server.