how to set timeout on service

Hi all,

Is there a way to set timeout on the service?? lets says i create some flow service that invoke services which will query to backend system… How can i set timeout to that invoked service, so if that services running time is more than 2 seconds then it will exit from flow service. i’ve tried to set timeout from the properties, but it seems that the exception will raised only after the service step completed. It’s not what i’m looking… Actually, i’m new in webmethod, so any suggestion will be helpfull…

thanks

And what about the service that takes more than 2 seconds ?
Does it need to be killed or continue its processing ?

Hello,

Looks like your question is more related to ‘How to handle ISRunTimeExceptions’ i.e. Exceptions that occur due to transient errors like FTP connection,DB connections etc.
If that’s the case, Then please refer to webMethods_Developer_User’s_Guide_7_1.pdf, Page 144.

Thank you,
Anil

Yup, the service that run takes more than 2 second need to be killed. For adapter service, on “Dynamic SQL” tab, i can set query timeout, so if the query takes more than 2 second the exception will raise. But for flow service, i don’t know how to do that things? thanks

Hi Anil,

I’ve already read the documentation that you recommend, but i still did not find the solution. What i’m trying is to limit the service runtime, So there are no services that more than 2 seconds. If the service takes more than 2 second, that service should return error description that explain timeout. thanks…

May I ask what is the motivation behind the 2 second timeout? Normally, integrations don’t have such tight performance concerns. And normally, IS-hosted components aren’t used (nor really geared for) supporting UI response times (which is what I am assuming is driving the questions).

If you really need to force such a thing, one approach would be in changing the way you call the service that you want to limit the wait for via mechanisms that support a timeout. pub.client:http accepts a timeout. pub.publish:publishAndWait accepts a waitTime (you could use a local publish). Of course using these increases the overhead and eats into the 2 second execution limit.

Dependingo of what your service is doing, I’m not sure that “killing” the service is a good idea, but you can do it with a java service with Thread.

You can try with a “publishandWait” but the calling service will continue.

Hi gvolt,

What you have figured out is right.

webMethods 8.0 version and prior releases works that way. Though the property is set to a certain time limit, the flow runs entirely and then throws execution…

In webMethods 8.2 v, this has been modified. It will throw error immediately if it takes more than the said time.

-Senthil

Interesting, if somewhat belated, change. I think everyone wanted the step timeout to behave that way from the beginning. Good to see that it finally does. Thanks for the info!

That said, I still question the need for a 2 second time out. Seems odd in an integration scenario.

Hi all, Thanks for your responses… its really help me… Seems i have to change the way i call the services, like using pub.client:http or webservice connector.

Dear Reamon,
Actually, I have to provide some eai services that query from various backend system. Those services is called by “X” system , but the problem is X cannot called all eai service in the same time / parallel. They can only call it in sequentially, service1 → return result ->service2->return result ->… . This causes the application runs to slow. However, User don’t want the applkication takes more than 7 second. So they choose to limit the services runtime using timeout.

Thanks a lot

I would suggest that it is system “X” that should enforce the timeout. It is the component that cares.

Hi Reamon, I don’t understand what you mean about “It is the component that cares”, Can you explain to me more… Thanks,

You stated: “User don’t want the applkication takes more than 7 second”

Since it is the application that cares about supporting the response times, it is the application that should do the timeouts, not the components that it calls.