You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/08/26 01:46:20 UTC

[GitHub] [dubbo] feng996 opened a new issue #8599: triple协议不支持应用级地址发现

feng996 opened a new issue #8599:
URL: https://github.com/apache/dubbo/issues/8599


   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   - [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.x
   * Operating System version: Ubuntu 18.04.5
   * Java version: 11
   * nacos version: 1.4.2
   
   ### Steps to reproduce this issue
   
   1. provider配置
   ```
   dubbo:
     application:
       metadata-type: remote
       register-mode: instance
     registry:
       address: nacos://${nacos.host}:${nacos.port}
     protocol:
       name: tri
       serialization: protobuf
   ```
   2. consumer配置
   ```
   dubbo:
     application:
       metadata-type: remote
       service-discovery:
         migration: APPLICATION_FIRST
     registry:
       address: nacos://${nacos.host}:${nacos.port}
   #    ?registry-type=${nacos.registry-type}
     protocol:
       name: tri
       serialization: protobuf
   ```
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Result
   
   ![image](https://user-images.githubusercontent.com/50915608/130789754-e2940dd9-1e08-43b6-b67e-aef4d3f77426.png)
   
   
   ### Actual Result
   
   ![image](https://user-images.githubusercontent.com/50915608/130886455-753a9d8f-fe18-48ac-8bd1-9da7376dcd41.png)
   
   
   If there is an exception, please attach the exception trace:
   
   java.lang.IllegalStateException: Failed to check the status of the service service.HelloService. No provider available for the service service.HelloService from the url dubbo://
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] plusmancn commented on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
plusmancn commented on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-908340169


   I have reproduced this problem, and the problem can be more specific:  
   
   The Triple protocol is not working on Spring integrated with Dubbo.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] feng996 commented on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
feng996 commented on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-907028126


   > @feng996 Can you provide a demo to help us confirming this question exists?
   
   [dubbo-samples-feedback.tar.gz](https://github.com/apache/dubbo/files/7065412/dubbo-samples-feedback.tar.gz)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] feng996 commented on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
feng996 commented on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-978870448


   添加 dubbo.application.protocol=tri
   3.0.4 consumer reference 还是会报no provider .... 
   demo放在 #8987 回复里了


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] guohao closed issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
guohao closed issue #8599:
URL: https://github.com/apache/dubbo/issues/8599


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] feng996 commented on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
feng996 commented on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-906964468


   > Nacos version should upgrade to 2.0.0 or above to support service discovery model. (This is limited by Nacos)
   
   使用2.0.2nacos也不行,dubbo协议可以,tri无法找到provider
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] feng996 commented on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
feng996 commented on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-978901763


   > 添加 dubbo.application.protocol=tri 3.0.4 consumer reference 还是会报no provider .... demo放在 #8987 回复里了
   
   使用注解引用时,再次指定protocol=tri,解决
   @DubboReference(providedBy = "feedback-provider", check = false, protocol = "tri")
       private HelloService helloService;
   
   看起来是provider配置里services key 为`interface:protocol`的原因("com.example.feedback.api.service.HelloService:tri")。
   但是不知道为什么在注解引用时,并没有把dubbo.protocol.name=tri这个信息加到后面,需要在reference里再次指定


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] plusmancn edited a comment on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
plusmancn edited a comment on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-912218330


   @feng996  I have found the cause of the problem which is not related to `dubbo-spring-boot-starter` as I first thought.
   
   The source is in `org.apache.dubbo.config.metadata.ServiceInstanceHostPortCustomizer`, let's have a look:
   ```java
   @Override
   public void customize(ServiceInstance serviceInstance) {
       String host = null;
       int port = -1;
       // ......
       Set<URL> urls = writableMetadataService.getExportedServiceURLs();
       if (CollectionUtils.isNotEmpty(urls)) {
           ApplicationModel applicationModel = serviceInstance.getApplicationModel();
           String preferredProtocol = applicationModel.getCurrentConfig().getProtocol();
           //  The default value of preferredProtocol is dubbo.
           if (preferredProtocol != null) {
               for (URL exportedURL : urls) {
                   // The protocol of exportedURL is tri
                   // because of tri != dubbo, the host and port will not be assigned values.
                   if (preferredProtocol.equals(exportedURL.getProtocol())) {
                       host = exportedURL.getHost();
                       port = exportedURL.getPort();
                       break;
                   }
               }
           } else {
               URL url = urls.iterator().next();
               host = url.getHost();
               port = url.getPort();
           }
           // If not the port of instace > 0, the application instance will not be registered to RegistryCenter(like Nacos, Zookeeper).
           // As a result, the consumer can't find the avaliabe providers when our settging is registry-mode=instance
           if (serviceInstance instanceof DefaultServiceInstance) {
               DefaultServiceInstance instance = (DefaultServiceInstance) serviceInstance;
               instance.setHost(host);
               instance.setPort(port);
           }
       }
   }
   ```
   
   For the moment, if you want both consumer and provider to force using `Application Discovery` in tri protocol, just change one line config of provider as follows:
   ```yaml
   dubbo:
     application:
       metadata-type: remote
       register-mode: instance
       protocol: tri  <==== HERE, set preferredProtocol as tri
   ```
   
   But, Dubbo official also needs to do two things for further promotion:
   1. Complete the docs: [Triple协议迁移指南](https://dubbo.apache.org/zh/docs/migration/migration-triple/) as soon as possible
   2. The logic of preferredProtocol was not user-friendly, we maybe should optimize it.
   
   Relate to #8666 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] plusmancn edited a comment on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
plusmancn edited a comment on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-908340169






-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] plusmancn edited a comment on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
plusmancn edited a comment on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-907005868


   @feng996 Can you provide a demo to help us confirming this question exists?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] plusmancn edited a comment on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
plusmancn edited a comment on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-912218330


   @feng996  I have found the cause of the problem which is not related to `dubbo-spring-boot-starter` as I first thought.
   
   The source is in `org.apache.dubbo.config.metadata.ServiceInstanceHostPortCustomizer`, let's have a look:
   ```java
   @Override
   public void customize(ServiceInstance serviceInstance) {
       String host = null;
       int port = -1;
       // ......
       Set<URL> urls = writableMetadataService.getExportedServiceURLs();
       if (CollectionUtils.isNotEmpty(urls)) {
           ApplicationModel applicationModel = serviceInstance.getApplicationModel();
           String preferredProtocol = applicationModel.getCurrentConfig().getProtocol();
           //  The default value of preferredProtocol is dubbo.
           if (preferredProtocol != null) {
               for (URL exportedURL : urls) {
                   // The protocol of exportedURL is tri
                   // because of tri != dubbo, the host and port will not be assigned values.
                   if (preferredProtocol.equals(exportedURL.getProtocol())) {
                       host = exportedURL.getHost();
                       port = exportedURL.getPort();
                       break;
                   }
               }
           } else {
               URL url = urls.iterator().next();
               host = url.getHost();
               port = url.getPort();
           }
           // If not the port of instace > 0, the application instance will not be registered to RegistryCenter(like Nacos, Zookeeper).
           // As a result, the consumer can't find the avaliabe providers when our settging is registry-mode=instance
           if (serviceInstance instanceof DefaultServiceInstance) {
               DefaultServiceInstance instance = (DefaultServiceInstance) serviceInstance;
               instance.setHost(host);
               instance.setPort(port);
           }
       }
   }
   ```
   
   For the moment, if you want both consumer and provider to force using `Application Discovery` in tri protocol, just change one line config of provider as follows:
   ```yaml
   dubbo:
     application:
       metadata-type: remote
       register-mode: instance
       protocol: tri  <==== HERE, set preferredProtocol as tri
   ```
   
   But, Dubbo official also needs to do two things for further promotion:
   1. Complete the docs: [Triple协议迁移指南](https://dubbo.apache.org/zh/docs/migration/migration-triple/) as soon as possible
   2. The logic of preferredProtocol was not user-friendly, we maybe should optimize it.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] plusmancn commented on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
plusmancn commented on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-907005868


   @feng996 Can you provide a demo to help us confirm this question exists?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-906947750


   Nacos version should upgrade to 2.0.0 or above to support service discovery model. (This is limited by Nacos)


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] plusmancn commented on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
plusmancn commented on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-908340169


   I have reproduced this problem, and the problem can be more specific:  
   
   The Triple protocol is not working on Spring integrated with Dubbo.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] plusmancn edited a comment on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
plusmancn edited a comment on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-908340169






-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] plusmancn commented on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
plusmancn commented on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-912218330


   @feng996  I have found the cause of the problem which is not related to `dubbo-spring-boot-starter` as I first thought.
   
   The source is in `org.apache.dubbo.config.metadata.ServiceInstanceHostPortCustomizer `,  let's have a look:
   ```java
   @Override
   public void customize(ServiceInstance serviceInstance) {
       String host = null;
       int port = -1;
       // ......
       Set<URL> urls = writableMetadataService.getExportedServiceURLs();
       if (CollectionUtils.isNotEmpty(urls)) {
           ApplicationModel applicationModel = serviceInstance.getApplicationModel();
           String preferredProtocol = applicationModel.getCurrentConfig().getProtocol();
           //  The default value of preferredProtocol is dubbo.
           if (preferredProtocol != null) {
               for (URL exportedURL : urls) {
                   // The protocol of exportedURL is tri
                   // because of tri != dubbo, the host and port will not be assigned values.
                   if (preferredProtocol.equals(exportedURL.getProtocol())) {
                       host = exportedURL.getHost();
                       port = exportedURL.getPort();
                       break;
                   }
               }
           } else {
               URL url = urls.iterator().next();
               host = url.getHost();
               port = url.getPort();
           }
           // If not the port of instace > 0, the application instance will not be registered to RegistryCenter(like Nacos, Zookeeper).
           // As a result, the consumer can't find the avaliabe providers when our settging is registry-mode=instance
           if (serviceInstance instanceof DefaultServiceInstance) {
               DefaultServiceInstance instance = (DefaultServiceInstance) serviceInstance;
               instance.setHost(host);
               instance.setPort(port);
           }
       }
   }
   ```
   
   For the moment, if you want both consumer and provider to force using `Application Discovery` in tri protocol, just change one line config of provider as follows:
   ```yaml
   dubbo:
     application:
       metadata-type: remote
       register-mode: instance
       protocol: tri  <==== HERE, set preferredProtocol as tri
   ```
   
   But, Dubbo official also needs to do two things for further promotion:
   1. Complete the docs: [Triple协议迁移指南](https://dubbo.apache.org/zh/docs/migration/migration-triple/) as soon as possible
   2. The logic of preferredProtocol was not user-friendly, we maybe should optimize it.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] feng996 removed a comment on issue #8599: triple不支持应用级地址发现

Posted by GitBox <gi...@apache.org>.
feng996 removed a comment on issue #8599:
URL: https://github.com/apache/dubbo/issues/8599#issuecomment-907028126


   > @feng996 Can you provide a demo to help us confirming this question exists?
   
   [dubbo-samples-feedback.tar.gz](https://github.com/apache/dubbo/files/7065412/dubbo-samples-feedback.tar.gz)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org