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/12/13 13:55:29 UTC

[GitHub] [dubbo] cuibobo opened a new issue #9400: 泛化调用时当consumer端服务刚启动时调用某个服务时会报No Provider,后续调用就正常

cuibobo opened a new issue #9400:
URL: https://github.com/apache/dubbo/issues/9400


    ApplicationConfig application = new ApplicationConfig();
           application.setName(this.applictionName);
           RegistryConfig registry = new RegistryConfig();
           registry.setAddress(this.registryAddress);
           application.setRegistry(registry);
   
           ReferenceConfig<GenericService> reference = new ReferenceConfig<GenericService>();
           
           reference.setInterface(context.getInterfaceName());
           reference.setVersion(context.getVersion());
           reference.setGroup(context.getGroup());
           reference.setGeneric(true);
           reference.setApplication(application);
           reference.setRetries(0);
           if (null != context.getInterfaceTimeout()) {
               reference.setTimeout(Integer.valueOf(context.getInterfaceTimeout().toString()));
           }
           
   //        GenericService genericService = reference.get();
           GenericService genericService = null;
           ReferenceConfigCache referenceConfigCache = ReferenceConfigCache.getCache();
           try {
               genericService = referenceConfigCache.get(reference);
               if (Objects.isNull(genericService)) {
                   referenceConfigCache.destroy(reference);
                   logger.error("dubbo genericService has exception!");
               }
           } catch (Exception e) {
               referenceConfigCache.destroy(reference);
               logger.error("dubbo genericService destroy has exception!");
           }
   dubbo 泛化调用时当consumer端服务刚启动时调用某个服务时会报No Provider,注册中心用的是zk。但是一般第二次调用就正常了。
   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] juzi214032 commented on issue #9400: 泛化调用时当consumer端服务刚启动时调用某个服务时会报No Provider,后续调用就正常

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


   ReferenceConfig 设置 check 为 false 即可


-- 
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] juzi214032 edited a comment on issue #9400: 泛化调用时当consumer端服务刚启动时调用某个服务时会报No Provider,后续调用就正常

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


   ReferenceConfig 设置 check 为 false 即可
   ```java
   referenceConfig.setCheck(false);
   ```


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