You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2018/04/26 05:48:51 UTC
[rocketmq] branch develop updated: Use access point url as name
server conditionally
This is an automated email from the ASF dual-hosted git repository.
lizhanhui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 6124695 Use access point url as name server conditionally
6124695 is described below
commit 61246957a7d453c4401abd64bf75bbc0034d044d
Author: shutian.lzh <sh...@alibaba-inc.com>
AuthorDate: Thu Apr 26 13:48:30 2018 +0800
Use access point url as name server conditionally
---
.../openmessaging/rocketmq/producer/AbstractOMSProducer.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/openmessaging/src/main/java/io/openmessaging/rocketmq/producer/AbstractOMSProducer.java b/openmessaging/src/main/java/io/openmessaging/rocketmq/producer/AbstractOMSProducer.java
index f733756..e40e2d4 100644
--- a/openmessaging/src/main/java/io/openmessaging/rocketmq/producer/AbstractOMSProducer.java
+++ b/openmessaging/src/main/java/io/openmessaging/rocketmq/producer/AbstractOMSProducer.java
@@ -52,11 +52,15 @@ abstract class AbstractOMSProducer implements ServiceLifecycle, MessageFactory {
this.rocketmqProducer = new DefaultMQProducer();
this.clientConfig = BeanUtils.populate(properties, ClientConfig.class);
- String accessPoints = clientConfig.getAccessPoints();
- if (accessPoints == null || accessPoints.isEmpty()) {
- throw new OMSRuntimeException("-1", "OMS AccessPoints is null or empty.");
+ if ("true".equalsIgnoreCase(System.getenv("OMS_RMQ_DIRECT_NAME_SRV"))) {
+ String accessPoints = clientConfig.getAccessPoints();
+ if (accessPoints == null || accessPoints.isEmpty()) {
+ throw new OMSRuntimeException("-1", "OMS AccessPoints is null or empty.");
+ }
+
+ this.rocketmqProducer.setNamesrvAddr(accessPoints.replace(',', ';'));
}
- this.rocketmqProducer.setNamesrvAddr(accessPoints.replace(',', ';'));
+
this.rocketmqProducer.setProducerGroup(clientConfig.getRmqProducerGroup());
String producerId = buildInstanceName();
--
To stop receiving notification emails like this one, please contact
lizhanhui@apache.org.