Is there some way to set a timeout for NodeJS backend server ?

We connect to a NodeJS backend server from our API Proxy. We have set a timeout value of 55 seconds in MP's http.properties (HTTPTransport.io.timeout.millis=55000). But we don't see the timeout occurring even though NodeJS backend takes more than 55 seconds to respond back. I think the timeout (HTTPTransport.io.timeout.millis) is good only for http/https backend servers. Can you please let me know if there's some other way to set the timeout value for NodeJS backend servers ?

1 2 1,231
2 REPLIES 2

Not applicable

Assuming this is an on-prem deployment since you mentioned http.properties. I believe there is an analogous nodejs.properties file that you can use for setting the timeout value for your script. Try setting the property script.tick.timeout.seconds=55 inside that properties file.

@clatimer1,

Thanks for your suggestion.

This is on public cloud. The property script.tick.timeout.seconds is set to 60 seconds already. However, the MP does not timeout and keeps waiting for the response from the NodeJS backend even after 60 seconds is elapsed.

I do see another property in nodejs.properties as shown below:

# If an API call does not write to the HTTP "output" stream after this period of time,
# we will raise a 503 error with an error code to that affect.
# Set to zero to disable this timeout.
# The default is 0.
http.request.timeout.seconds=0

Do you think this is property that I should be setting to an appropriate value to ensure MP timesout while interacting with NodeJS backend ?

Thanks,

Amar