vongosling closed pull request #18: Adjust config property name
RetryAnotherBrokerWhenNotStoreOK -> retr…
URL: https://github.com/apache/rocketmq-spring/pull/18
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
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 DefaultMQProducer defaultMQProducer(RocketMQProperties
rocketMQProperties
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 void setProducer(RocketMQProperties.Producer producer)
{
/**
* 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 void setRetryTimesWhenSendAsyncFailed(int
retryTimesWhenSendAsyncFailed)
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 void testRocketMQListenerContainer() {
@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 void testRocketMQListenerWithCustomObjectMapper() {
@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);
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services