lvanYi commented on issue #9243: URL: https://github.com/apache/dubbo/issues/9243#issuecomment-1338863169
> > > > 不过我和你一样, 每次加新接口总报 No provider available for the service > > > > > > 我加上解决了,什么原理 > > 因为spring-cloud,新版有两种模式,新版默认使用的dubbo的新模式, 加spring-cloud是使用旧版模式。 > > 我将我这几年遇到并解决的问题,列在下面这个git地址里了 > > https://github.com/wangzihaogithub/spring-cloud-alibaba-dubbo-issues-1595 > > # spring-cloud-alibaba-dubbo-issues-1595 (解决一些项目中遇到的问题) > #### 项目介绍(总共就4个Java文件) > 分享一些作者在用spring-cloud-alibaba-dubbo时项目中遇到的问题, 通过将下面文件,路径原封不动复制到项目里,以达到覆盖源码的方式解决。 > > **1. 重写AbstractSpringCloudRegistry.class以解决获得支持** > > ``` > 同时需要在yml里加 > dubbo.cloud.registry-type: 'spring-cloud' > dubbo.consumer.reconnect: true > dubbo.consumer.parameters.send.reconnect: true > > 1.服务挂不上No provider > 2.一直掉老IP/端口 > 3.允许提供者与消费者无序启动 > 4.允许 -kill 9 > ``` > > **2. 重写DubboGenericServiceFactory.class以解决获得支持** > > ``` > 1.解决接入其他注册中心(例:zk)的dubbo接口时,接口元信息可能会掉到其他注册中心上 > 2.解决一直掉老IP/端口 > ``` > > **3. 重写ReferenceAnnotationBeanPostProcessor.class以解决获得支持** > > ``` > 1.解决升级dubbo-2.7.15后,自定义注解用不了 > ``` > > **4. 重写NetUtils.class以解决获得支持** > > ``` > 1.解决开VPN时, 有时获取VPN的IP,有时获取正常IP,导致服务掉不通。 > 2.解决开发环境多网卡时,IP总随机。 > ``` dubbo.consumer.reconnect: true dubbo.consumer.parameters.send.reconnect: true 这两条我一直没有加,目前基本上没有出现找不到提供者的情况,我不清楚不加有没有风险,或者说加上会不会出现别的问题 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
