dubbo重试机制

dubbo框架的接口如果在默认时间内调用失败或者超时,会重试2次,这样会导致有时会有3条数据,比如电商的下订单的情况,会导致有3条订单数据,实际只有一条数据。

修改方法:

<dubbo:reference id="xxxxService"
  interface="xxxx.xxxxService">
  <dubbo:method name="aaaaaa" timeout="10000" retries="0" />
 </dubbo:reference>

增加超时时间为一个合理的值,同时将retires设为0,如果为2,表示重试2次。

dubbo:method表示指定该service里面的某一个方法采用该机制,其他的不适应

猜你喜欢

转载自falseking.iteye.com/blog/2320185