0
votes

Request is getting timed out while invoking java adapters using WLResourceRequest in Mobilefirst 8.0 since our backend services are taking more than 10 seconds to respond.

MFP Version : 8.0.0.00-20171025-0319

Tried the below method to set the timeout. But it is not reflecting.

var options = {
    timeout : 720000
}     
resourceRequest = new WLResourceRequest("/adapters/"+request.adapter+"/"+procedure,WLResourceRequest.POST,options);
resourceRequest.setTimeout(720000);

Getting below response in error callback.

{
  "status": -1,
  "responseText": "",
  "responseHeaders": {},
  "errorMsg": "Request timed out.",
  "errorCode": "REQUEST_TIMEOUT"
}
1
Are you sure that the request is reaching the server at all? It could be a network issue that is causing the time out. Could you try a sample ping to the MFP server and verify? - Keerthi
If you were to try another adapter that returns a hardcoded value, does it work? Also, is this case specific to any platform or you see it in Android and iOS? - Vivin K
Request is reaching server, as we are able to get responses which take less than 10 seconds. - Ayesha M
@Ayesha I verified the WLResourcerequest with different timeout values and it is reflecting . In fact i tried the same timeout value as you said above also . There must be two reasons to get timeout error 1.network issue 2.The response time from the adapter is more than timeout value you specified.(Are you providing delay in adapter return value?If yes, are you sure it is less than 720000 ?) - Shubha S

1 Answers

0
votes

The issue is with WLRequestOptions class in Ibm library. The time out value is hardcoded to 10 seconds. Raised PMR For the same.