This topic describes how to set the timeout period for High-speed Service Framework (HSF) applications. This topic also provides the priorities of different configuration tags for different objects.

Solution

You can set the timeout period for HSF applications by using the methodSpecials and clientTimeout configuration tags.

  • methodSpecials: sets the timeout period, in milliseconds, for a single method.
  • clientTimeout: sets the global timeout period, in milliseconds, for all methods in an interface.

The following information shows the priorities of different configuration tags for different objects. The priorities are sorted in descending order.

methodSpecials for a consumer > clientTimeout for a consumer > methodSpecials for a provider > clientTimeout for a provider

The following sample code shows you how to use the configuration tags to set the timeout period for a consumer:

<hsf:consumer id="service" interface="com.taobao.edas.service.SimpleService"
version="1.1.0" group="test1" clientTimeout="3000"
target="10.1.6.57:12200?_TIMEOUT=1000" maxWaitTimeForCsAddress="5000">
<hsf:methodSpecials>
    <hsf:methodSpecial name="sum" timeout="2000" ></hsf:methodSpecial>
</hsf:methodSpecials>
</hsf:consumer>