You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "uzdz (GitHub)" <gi...@apache.org> on 2018/10/23 11:43:01 UTC
[GitHub] [incubator-dubbo-spring-boot-project] uzdz opened issue #297: @Reference注解引用重试问题
项目:dubbo-spring-boot-starter
版本:0.2.0
设置:
@Reference(version = "0.0.1", retries = 0)
public EmployeeApi employeeApi;
单独设置某个引用超时后重试次数为0,即不启动重试,但是由于@Reference注解中retries默认为0,通过自测发现,设置retries为0是无效的,默认还会重试2次,所以请问如何设置某个引用关闭重试。
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] mercyblitz closed issue #297: @Reference注解引用重试问题
Posted by "mercyblitz (GitHub)" <gi...@apache.org>.
[ issue closed by mercyblitz ]
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] sarins commented on issue #297: @Reference注解引用重试问题
Posted by "sarins (GitHub)" <gi...@apache.org>.
me 2
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] sarins commented on issue #297: @Reference注解引用重试问题
Posted by "sarins (GitHub)" <gi...@apache.org>.
I have no idea.
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] sarins commented on issue #297: @Reference注解引用重试问题
Posted by "sarins (GitHub)" <gi...@apache.org>.
`ConfigurableApplicationContext ctx = SpringApplication.run(ThirdpartyProxyApplication.class, args);
ConsumerConfig consumerConfig = ctx.getBean(ConsumerConfig.class);
if (null != consumerConfig) {
consumerConfig.setCheck(false);
consumerConfig.setRetries(0);
consumerConfig.setTimeout(2000);
}`
BTW, it may works, but i haven't tested it.
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] Gnywin commented on issue #297: @Reference注解引用重试问题
Posted by "Gnywin (GitHub)" <gi...@apache.org>.
> I have no idea.
use -1 set the reference and service
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] uzdz commented on issue #297: @Reference注解引用重试问题
Posted by "uzdz (GitHub)" <gi...@apache.org>.
> ```java
> ConfigurableApplicationContext ctx = SpringApplication.run(ThirdpartyProxyApplication.class, args);
> ConsumerConfig consumerConfig = ctx.getBean(ConsumerConfig.class);
> if (null != consumerConfig) {
> consumerConfig.setCheck(false);
> consumerConfig.setRetries(0);
> consumerConfig.setTimeout(2000);
> }
> ```
>
> BTW, it may works, but i haven't tested it.
It is indeed available,but I just want to retry a reference.
@Reference annotations cannot be properly resolved.
I think it's a bug.
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] backkoms commented on issue #297: @Reference注解引用重试问题
Posted by "backkoms (GitHub)" <gi...@apache.org>.
retries = -1设置有效,但比较别扭。
在service引入层面设置不重试,即对service内部的所有方法不能重试,对于service内部一些幂等性的接口方法无法特殊设置吗?
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] Gnywin commented on issue #297: @Reference注解引用重试问题
Posted by "Gnywin (GitHub)" <gi...@apache.org>.
> > 我也是啊,在service 中设置 依旧无效,你有解决办法了吗?
>
> 暂时没有解决,目前通过设置全局引用幂等解决的问题,可能社区维护人员最近比较忙吧。
> I have no idea.
> > 我也是啊,在service 中设置 依旧无效,你有解决办法了吗?
>
> 暂时没有解决,目前通过设置全局引用幂等解决的问题,可能社区维护人员最近比较忙吧。
两边使用 -1 试试,可以生效,你的应用幂等是怎么做的?我学习下
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] mercyblitz commented on issue #297: @Reference注解引用重试问题
Posted by "mercyblitz (GitHub)" <gi...@apache.org>.
Sorry for delayed response, it will be fixed in next release.
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] uzdz commented on issue #297: @Reference注解引用重试问题
Posted by "uzdz (GitHub)" <gi...@apache.org>.
> Sorry for delayed response, it will be fixed in next release.
OK, can you mark it as bug?
Because I will pay attention to the repair progress of this bug.
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] sarins commented on issue #297: @Reference注解引用重试问题
Posted by "sarins (GitHub)" <gi...@apache.org>.
```java
ConfigurableApplicationContext ctx = SpringApplication.run(ThirdpartyProxyApplication.class, args);
ConsumerConfig consumerConfig = ctx.getBean(ConsumerConfig.class);
if (null != consumerConfig) {
consumerConfig.setCheck(false);
consumerConfig.setRetries(0);
consumerConfig.setTimeout(2000);
}
```
BTW, it may works, but i haven't tested it.
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] uzdz commented on issue #297: @Reference注解引用重试问题
Posted by "uzdz (GitHub)" <gi...@apache.org>.
对于生产段设置@reference(version = "0.0.1", retries = -1)感觉有点别扭...
理论上来说,消费者调用生产者的API超时,重试次数应该由消费者中的@Reference中的retries来决定重试次数。而不是由生产端设置其生产的API对外暴露超时后的重试次数。
不知道是不是bug,如果社区人看到了这个issues,如果存在bug就请修复。
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] mercyblitz commented on issue #297: @Reference注解引用重试问题
Posted by "mercyblitz (GitHub)" <gi...@apache.org>.
Please update dependencies in your Maven `pom.xml`, like this:
```xml
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>0.2.0</version>
</dependency>
<!-- Dubbo -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.6.5</version>
</dependency>
<!-- Spring Context Extras -->
<dependency>
<groupId>com.alibaba.spring</groupId>
<artifactId>spring-context-support</artifactId>
<version>1.0.2</version>
</dependency>
```
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] uzdz commented on issue #297: @Reference注解引用重试问题
Posted by "uzdz (GitHub)" <gi...@apache.org>.
在dubbo-spring-boot-starter这个项目中设置消费者调用生产者超时重试次数的解决方法有以下两种(经测试)。
1)通过设置消费端的yml或properties中的dubbo.consumer.retries的值为项目中所有调用生产者API设置重试次数。
2)通过在生产端中的某个需要设置retries的@Reference注解中设置@Reference(version = "0.0.1", retries = -1)来限制该对外暴露的API消费者调用超时时的重试次数。
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] uzdz commented on issue #297: @Reference注解引用重试问题
Posted by "uzdz (GitHub)" <gi...@apache.org>.
> 我也是啊,在service 中设置 依旧无效,你有解决办法了吗?
暂时没有解决,目前通过设置全局引用幂等解决的问题,可能社区维护人员最近比较忙吧。
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo-spring-boot-project] sarins commented on issue #297: @Reference注解引用重试问题
Posted by "sarins (GitHub)" <gi...@apache.org>.
```java
ConfigurableApplicationContext ctx = SpringApplication.run(ThirdpartyProxyApplication.class, args);
ConsumerConfig consumerConfig = ctx.getBean(ConsumerConfig.class);
if (null != consumerConfig) {
consumerConfig.setCheck(false);
consumerConfig.setRetries(0);
consumerConfig.setTimeout(2000);
}
```
BTW, it may works, but i haven't tested it.
[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/297 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org