From 728ad30181a82877d8f137229d5b91d9925b710e Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Fri, 3 Aug 2018 23:57:16 +0800 Subject: [PATCH 1/2] Correct the reference retries default value 0 to 2 --- .../java/com/alibaba/dubbo/config/annotation/Reference.java | 2 +- .../main/java/org/apache/dubbo/config/annotation/Reference.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/config/annotation/Reference.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/config/annotation/Reference.java index 450170a20c4..4c1ca979a17 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/config/annotation/Reference.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/config/annotation/Reference.java @@ -75,7 +75,7 @@ String layer() default ""; - int retries() default 0; + int retries() default 2; String loadbalance() default ""; diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Reference.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Reference.java index 3a2fe03046b..63e2cd5f1d1 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Reference.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Reference.java @@ -164,7 +164,7 @@ * * @see Constants#DEFAULT_RETRIES */ - int retries() default 0; + int retries() default 2; /** * Load balance strategy, legal values include: random, roundrobin, leastactive From 0686c96a8ea942b998f16425cbc296c8db2c2660 Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Sat, 4 Aug 2018 18:10:37 +0800 Subject: [PATCH 2/2] fix the unit test error --- .../annotation/AnnotationPropertyValuesAdapterTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/AnnotationPropertyValuesAdapterTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/AnnotationPropertyValuesAdapterTest.java index d5889fa7b33..94148e66d74 100644 --- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/AnnotationPropertyValuesAdapterTest.java +++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/AnnotationPropertyValuesAdapterTest.java @@ -113,7 +113,7 @@ public Map convert(String[] source) { Assert.assertEquals("ondisconnect", referenceBean.getOndisconnect()); Assert.assertEquals("owner", referenceBean.getOwner()); Assert.assertEquals("layer", referenceBean.getLayer()); - Assert.assertEquals(Integer.valueOf(2), referenceBean.getRetries()); + Assert.assertEquals(Integer.valueOf(1), referenceBean.getRetries()); Assert.assertEquals("random", referenceBean.getLoadbalance()); Assert.assertEquals(true, referenceBean.isAsync()); Assert.assertEquals(Integer.valueOf(1), referenceBean.getActives()); @@ -147,7 +147,7 @@ private static class TestBean { check = false, init = true, lazy = true, stubevent = true, reconnect = "reconnect", sticky = true, proxy = "javassist", stub = "stub", cluster = "failover", connections = 1, callbacks = 1, onconnect = "onconnect", - ondisconnect = "ondisconnect", owner = "owner", layer = "layer", retries = 2, + ondisconnect = "ondisconnect", owner = "owner", layer = "layer", retries = 1, loadbalance = "random", async = true, actives = 1, sent = true, mock = "mock", validation = "validation", timeout = 2, cache = "cache", filter = {"default", "default"}, listener = {"default", "default"}, parameters = {"key1", "value1"}, application = "application",