Is it possible to set the timeout time for a REST resource?

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

Is it possible to set the timeout time for a REST resource?

#1

Postby dvanhussel » Mon Apr 01, 2019 9:35 am

Hi,

We are having some issues with a REST service we call from Ebase using a REST-resource. The service works ok, but it takes a long time to complete. So we are getting timeouts, while in fact the service responses with 200 a bit later.
Is it possible to set the timeout for this resource?

Regards,

David
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

Re: Is it possible to set the timeout time for a REST resource?

#2

Postby Jon » Mon Apr 01, 2019 10:53 am

You can do this using the services.rest API, all the methods accept a RestOptions object as the last parameter and you can specify both socket timeout and connection timeout using this e.g.

Code: Select all

var opts = new RestOptions();
opts.socketTimeout= 600;     // 10 mins
var response = services.rest.get(uri, headers, null, null, opts);
0 x

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

Re: Is it possible to set the timeout time for a REST resource?

#3

Postby dvanhussel » Tue Apr 02, 2019 7:06 am

Hi Jon,

Sorry for not mentioning that I knew that this can be solved this way. But we allready have a working resource and was wondering if I could keep using that and set the timeout.

I will refactor this to using your suggestion.

Regards,

David
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

Re: Is it possible to set the timeout time for a REST resource?

#4

Postby Jon » Tue Apr 02, 2019 7:46 am

No, sorry. There isn't a way to do this using a resource.
0 x


Who is online

Users browsing this forum: Google [Bot] and 9 guests