7

We are using DXA 1.5 and we have a requirement that we need to set timeout value for the content service so that if the content is not being retrieve say within 30 seconds we need to throw 502 error page. I have checked the cd_storage_config file for content service but couldn't see any appropriate attribute. Are there any setting available we can set for service timeout from DXA config.

Thanks, Indra

4

As per best of my knowledge, there is no configuration available in the DXA framework to configure timeout of any request. You may do it using standard http request time out setting(code may vary for .Net and Java). To handle it in your application code you can create your own controller and write code to handle(throw 502 error) it. You can do timeout setting in DXA .Net in web configuration file using:

<system.web>
  <httpRuntime executionTimeout="30" /> 
</system.web> 

or if you want to set if for any specific controller action:

<location path="ControllerName/ActionName">
    <system.web>
        <httpRuntime executionTimeout="30"/>
    </system.web>
</location>

In Controller code:

HttpContext.Server.ScriptTimeout = 30;
  • Hi Mukesh I have tried both options but there is no effect as such. Well after going through an article from ASP.Net team I found that ExecutionTimeout / ScriptTimeout only apply to synchronous handlers in ASP.NET. Both MVC and Web API are completely asynchronous (even if you're not using async controllers) pipelines, so ExecutionTimeout / ScriptTimeout have no effect. – Indra May 2 '17 at 14:33
3

You could try adding the following configuration to Web.Config under appSettings:

<appSettings>
    ... other content service related config here ...
    <add key="service-timeout" value="30" />
</appSettings>

This should set the timeout for all the Content Delivery microservices to 30 seconds.

0

you can set the timeout value in cd_storage_conf.xml by adding the Transaction tag

   </Storages>
   <Transaction Timeout="240000" MonitorInterval="5000" />
</Global>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.