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

liujun pushed a commit to branch cloud-native
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit e9a9e4711ea7b82f4c3a164c37059570ab391aaf
Author: ken.lj <ken.lj...@gmail.com>
AuthorDate: Mon Aug 12 16:52:28 2019 +0800

    exclude injvm and registry protocol
---
 .../src/main/java/org/apache/dubbo/bootstrap/DubboBootstrap.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-bootstrap/src/main/java/org/apache/dubbo/bootstrap/DubboBootstrap.java 
b/dubbo-bootstrap/src/main/java/org/apache/dubbo/bootstrap/DubboBootstrap.java
index 4189238..457116c 100644
--- 
a/dubbo-bootstrap/src/main/java/org/apache/dubbo/bootstrap/DubboBootstrap.java
+++ 
b/dubbo-bootstrap/src/main/java/org/apache/dubbo/bootstrap/DubboBootstrap.java
@@ -773,14 +773,19 @@ public class DubboBootstrap {
     private String findOneProtocolForServiceInstance(Set<String> protocols) {
         String result = null;
         for (String protocol : protocols) {
-            if ("rest".equals(protocol)) {
+            if ("rest".equalsIgnoreCase(protocol)) {
                 result = protocol;
                 break;
             }
         }
 
         if (result == null) {
-            result = protocols.iterator().next();
+            for (String protocol : protocols) {
+                if (!"injvm".equalsIgnoreCase(protocol) && 
"registry".equalsIgnoreCase(protocol)) {
+                    result = protocol;
+                    break;
+                }
+            }
         }
         return result;
     }

Reply via email to