dubbo配置timeout超时时间

dubbo配置timeout超时时间


在dubbo的provider和consumer的配置文件中,如果都配置了timeout的超时时间,dubbo默认以consumer中配置的时间为准。

provider.xml的配置:

<dubbo:service timeout="4000" retries="0" interface="com.dingding.tms.bms.service.BillingZfbCodOrderService" ref="billingZfbCodOrderService" registry="globalRegistry"/>

conusmer中的配置:

<dubbo:reference id="billingInterService" interface="com.dingding.tms.bms.service.BillingInterService" protocol="dubbo" check="false" registry="globalRegistry" timeout="3000"/>

这个service在调用时的超时时间就是3秒。

另外,

1,consumer会在超过3秒时得到一个调用超时的异常。

2,provider中代码的执行不会因为超时而中断,在执行完毕后,会得到一个dubbo的警告。

版权声明:本文为chao2263263364原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。