edit-icon download-icon

How do I set the timeout period for HSF

Last Updated: Jan 16, 2018

Use the HSF tags methodSpecials and clientTimeout for configuration.

  • methodSpecials: Sets the timeout time (unit: ms) for a single method.
  • clientTimeout: Sets the unified timeout time (unit: ms) for all methods in the API.

The timeout time settings are sorted in descending order of priority as follows:

methodSpecials for the Consumer > clientTimeout for the Consumer > methodSpecials for the Provider > clientTimeout for the Provider

An example of the Consumer tag settings is described as follows:

<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>
Thank you! We've received your feedback.