为什么dubbo提供者重试配置无效?

发布于 2025-01-17 01:01:48 字数 483 浏览 2 评论 0原文

dubbo版本:2.7.14 春云&&注册中心 nacos 2.0.3

在此处输入图像描述我在application.yml中设置了dubbo.provider.retries=0,当它注册到nacos时,似乎配置生效了。

输入图片此处描述但是当消费者调用其中一个方法时,消费者仍然重试了3次(默认次数)。那么为什么配置无效让我感到困惑。

如果您有什么想法,请告诉我,谢谢!抱歉我的英语不好...

dubbo version:2.7.14
spring cloud && nacos 2.0.3 for registration center

enter image description here
I set dubbo.provider.retries=0 in application.yml, and when it registers to nacos, seems that the configuration is effetive.

enter image description here
But when the consumer invoke one of the methods, consumer still retried 3 times(defalut times). So why the configuration is ineffetive confuse me.

If you have some ideas, please tell me, thanks! Sorry for my poor English...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

隐诗 2025-01-24 01:01:48

检查消费者的配置。
https://dubbo.apache.org/zh/docs /v2.7/user/configuration/xml/
Consumer的配置具有更高的优先级。

覆盖和优先级
以超时为例,这里是优先级,从高到低(重试、负载平衡、活动也适用相同的规则):
方法级别,接口级别,默认/全局级别
在同一级别,消费者的优先级高于提供者

Check configuration of consumer.
https://dubbo.apache.org/zh/docs/v2.7/user/configuration/xml/
Configuration of consumer has a higher priority.

Overrides and Priorities
Take timeout as an example, here is the priorities, from high to low (retries, loadbalance, actives also applies the same rule):
method level,interface level,default/global level
at the same level, consumer has higher priority than provider

猛虎独行 2025-01-24 01:01:48

它的重试配置和超时配置有所不同。
正如 FailoverClusterInvoker 中所知,当调用程序关闭时,它将重试其他调用程序。
但是当有两个不同的调用者重试时,调用者应该选择哪个效果。

对于dubbo 2.7,重试来自url消费者,

int len = getUrl().getMethodParameter(methodName, RETRIES_KEY, DEFAULT_RETRIES) + 1;

当调用者创建时,它将被多次引用
org.apache.dubbo.rpc.cluster.support.ClusterUtils.mergeUrl
使用最终提供者的配置

并在 3.2 中
此 getUrl() 仅在参考配置中的配置时更改。

在超时中,每个提供者调用者都可以有自己的超时。

it has differenc in retries config with timeout config.
so as known in FailoverClusterInvoker ,it will retry an other invoker when invoker is down.
but when there are two invokers with difference retries invoker shoule which effect.

as for dubbo 2.7 the retry come from url consumer

int len = getUrl().getMethodParameter(methodName, RETRIES_KEY, DEFAULT_RETRIES) + 1;

it will be referesh many times as invoker be create in
org.apache.dubbo.rpc.cluster.support.ClusterUtils.mergeUrl
and use final provider's config

and in 3.2
this getUrl() only changed when config in reference config.

in timeout every provider invoker can has own timeout.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文