You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2019/01/17 13:20:37 UTC

[rocketmq-spring] 31/37: Adjust config property name RetryAnotherBrokerWhenNotStoreOK -> retryNextServer

This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-spring.git

commit 0abbd0b632eefeb9be56727c008372f9170debda
Author: walking98 <wi...@gmail.com>
AuthorDate: Wed Dec 19 15:52:40 2018 +0800

    Adjust config property name RetryAnotherBrokerWhenNotStoreOK  -> retryNextServer
---
 README.md                                                      |  4 ++--
 README_zh_CN.md                                                |  4 ++--
 .../rocketmq/spring/config/RocketMQAutoConfiguration.java      |  2 +-
 .../org/apache/rocketmq/spring/config/RocketMQProperties.java  | 10 +++++-----
 .../rocketmq/spring/config/RocketMQAutoConfigurationTest.java  |  4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index 9f42552..37264c3 100644
--- a/README.md
+++ b/README.md
@@ -93,11 +93,11 @@ public class ProducerApplication implements CommandLineRunner{
 > More relevant configurations for producing:
 >
 > ```properties
-> rocketmq.producer.retry-times-when-send-async-failed=0
 > rocketmq.producer.send-message-timeout=300000
 > rocketmq.producer.compress-message-body-threshold=4096
 > rocketmq.producer.max-message-size=4194304
-> rocketmq.producer.retry-another-broker-when-not-store-ok=false
+> rocketmq.producer.retry-times-when-send-async-failed=0
+> rocketmq.producer.retry-next-server=true
 > rocketmq.producer.retry-times-when-send-failed=2
 > ```
 
diff --git a/README_zh_CN.md b/README_zh_CN.md
index 82bb24e..a150e75 100644
--- a/README_zh_CN.md
+++ b/README_zh_CN.md
@@ -125,11 +125,11 @@ public class ProducerApplication implements CommandLineRunner{
 > 更多发送相关配置
 >
 > ```properties
-> rocketmq.producer.retry-times-when-send-async-failed=0
 > rocketmq.producer.send-message-timeout=300000
 > rocketmq.producer.compress-message-body-threshold=4096
 > rocketmq.producer.max-message-size=4194304
-> rocketmq.producer.retry-another-broker-when-not-store-ok=false
+> rocketmq.producer.retry-times-when-send-async-failed=0
+> rocketmq.producer.retry-next-server=true
 > rocketmq.producer.retry-times-when-send-failed=2
 > ```
 
diff --git a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/config/RocketMQAutoConfiguration.java b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/config/RocketMQAutoConfiguration.java
index c031335..ee35f81 100644
--- a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/config/RocketMQAutoConfiguration.java
+++ b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/config/RocketMQAutoConfiguration.java
@@ -60,7 +60,7 @@ public class RocketMQAutoConfiguration {
         producer.setRetryTimesWhenSendAsyncFailed(producerConfig.getRetryTimesWhenSendAsyncFailed());
         producer.setMaxMessageSize(producerConfig.getMaxMessageSize());
         producer.setCompressMsgBodyOverHowmuch(producerConfig.getCompressMessageBodyThreshold());
-        producer.setRetryAnotherBrokerWhenNotStoreOK(producerConfig.isRetryAnotherBrokerWhenNotStoreOk());
+        producer.setRetryAnotherBrokerWhenNotStoreOK(producerConfig.isRetryNextServer());
 
         return producer;
     }
diff --git a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/config/RocketMQProperties.java b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/config/RocketMQProperties.java
index 9c8ce89..778ba77 100644
--- a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/config/RocketMQProperties.java
+++ b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/config/RocketMQProperties.java
@@ -78,7 +78,7 @@ public class RocketMQProperties {
         /**
          * Indicate whether to retry another broker on sending failure internally.
          */
-        private boolean retryAnotherBrokerWhenNotStoreOk = false;
+        private boolean retryNextServer = false;
 
         /**
          * Maximum allowed message size in bytes.
@@ -125,12 +125,12 @@ public class RocketMQProperties {
             this.retryTimesWhenSendAsyncFailed = retryTimesWhenSendAsyncFailed;
         }
 
-        public boolean isRetryAnotherBrokerWhenNotStoreOk() {
-            return retryAnotherBrokerWhenNotStoreOk;
+        public boolean isRetryNextServer() {
+            return retryNextServer;
         }
 
-        public void setRetryAnotherBrokerWhenNotStoreOk(boolean retryAnotherBrokerWhenNotStoreOk) {
-            this.retryAnotherBrokerWhenNotStoreOk = retryAnotherBrokerWhenNotStoreOk;
+        public void setRetryNextServer(boolean retryNextServer) {
+            this.retryNextServer = retryNextServer;
         }
 
         public int getMaxMessageSize() {
diff --git a/rocketmq-spring-boot/src/test/java/org/apache/rocketmq/spring/config/RocketMQAutoConfigurationTest.java b/rocketmq-spring-boot/src/test/java/org/apache/rocketmq/spring/config/RocketMQAutoConfigurationTest.java
index c3e2d00..c719e8c 100644
--- a/rocketmq-spring-boot/src/test/java/org/apache/rocketmq/spring/config/RocketMQAutoConfigurationTest.java
+++ b/rocketmq-spring-boot/src/test/java/org/apache/rocketmq/spring/config/RocketMQAutoConfigurationTest.java
@@ -84,7 +84,7 @@ public class RocketMQAutoConfigurationTest {
 
     @Test
     public void testRocketMQListenerWithCustomObjectMapper() {
-        runner.withPropertyValues("spring.rocketmq.name-server=127.0.0.1:9876").
+        runner.withPropertyValues("rocketmq.name-server=127.0.0.1:9876").
                 withUserConfiguration(TestConfig.class, CustomObjectMapperConfig.class).
                 run((context) -> {
                     assertThat(context).hasSingleBean(DefaultRocketMQListenerContainer.class);
@@ -95,7 +95,7 @@ public class RocketMQAutoConfigurationTest {
 
     @Test
     public void testRocketMQListenerWithSeveralObjectMappers() {
-        runner.withPropertyValues("spring.rocketmq.name-server=127.0.0.1:9876").
+        runner.withPropertyValues("rocketmq.name-server=127.0.0.1:9876").
                 withUserConfiguration(TestConfig.class, CustomObjectMappersConfig.class).
                 run((context) -> {
                     assertThat(context).hasSingleBean(DefaultRocketMQListenerContainer.class);