Closed zqiheng closed 5 months ago
@zqiheng 在 SOFABoot 应用中,RPC 服务的注册通常是在应用的健康检查阶段完成后才执行的,从你的 demo 里看到你并未引入健康检查相关功能,因此 RPC 服务没有自动发布。
你有两个解决方案:
引入 SOFABoot 的健康检查依赖,这样你的 RPC 服务会在健康检查通过后自动发布
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>actuator-sofa-boot-starter</artifactId>
</dependency>
不引入 SOFABoot 的健康检查依赖,通过配置开启 RPC 服务的自动发布:
sofa.boot.rpc.enableAutoPublish=true
非常感谢,按照上述两种方案分别测试后,都可以注册成功!
本地测试项目可以正常启动,日志显示 Service 已经注册完成。![image](https://github.com/sofastack/sofa-boot/assets/34306759/85da024b-36ea-4f9d-a3b2-c56014214391)
但是在 Nacos 页面上不能看见注册的 Service。
然后使用 Consumer 调用服务也的确报错。![image](https://github.com/sofastack/sofa-boot/assets/34306759/cd801e93-1c89-417a-a634-886f8a917189)
不知道是我的配置问题还是环境或者版本问题,麻烦帮我看一下,谢谢!示例代码
使用的组件版本: