You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/11/15 02:51:05 UTC

[GitHub] [rocketmq-spring] vongosling commented on a change in pull request #171: [ISSUE #8] Offer a more user-friendly format to configure nameserver

vongosling commented on a change in pull request #171: [ISSUE #8] Offer a more user-friendly format to configure nameserver
URL: https://github.com/apache/rocketmq-spring/pull/171#discussion_r346643003
 
 

 ##########
 File path: rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/RocketMQUtil.java
 ##########
 @@ -254,4 +254,20 @@ public static String getInstanceName(RPCHook rpcHook, String identify) {
             .append(separator).append(UtilAll.getPid());
         return instanceName.toString();
     }
+
+    public static String getNameServerString(List<String> nameServer) {
+        if (nameServer == null || nameServer.isEmpty()) {
+            throw new IllegalArgumentException("property nameServer is empty");
+        }
+        String nameServerToString;
+        if (nameServer.size() > 1) {
+            nameServerToString = String.join(";", nameServer);
+        } else {
+            nameServerToString = nameServer.get(0);
+            if (nameServerToString.contains(";")) {
+                log.warn("name-server format `host:port;host:port` is deprecated.");
 
 Review comment:
   Should have a recommendation for a newer style.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services