function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Enrico Maria BalattiEnrico Maria Balatti 

Continuation Timeout: retry mechanisms

Dear all,

I am using Continuation to manage asyncronous callouts.
I set the maximum timeout (limit si 120seconds).
Unfortunately one endpoint webservice is taking more time, so I receive a Timeout Exception.

I would like to know is there is a best practice to manage continuation timeout retry. I am thinking two possible alternative:

1. implement Continuation retyr on Visualforce Page (using actionFunction calls that retry basing on a controller variable that catch the timeout exceptions). I need to use Visuaforce logic because Continuation cannot be triggered from Apex directly
2. implement a custom asyncronous mechanism. So no more adopt continuation in this case but make the callout (store in a custom object record a transaction id) and than let the external system call me using that transaction id in order to handle the async callback

What is in you opinion the better way. There are other better alternatives?
BR
Enrico