Tencent / spring-cloud-tencent

Spring Cloud Tencent is a Spring Cloud based Service Governance Framework provided by Tencent.
Other
3.18k stars 493 forks source link

服务注册必须添加spring-boot-starter-web包才生效 #537

Closed beiming-org closed 2 years ago

beiming-org commented 2 years ago

Describe the bug 服务注册必须添加spring-boot-starter-web包才生效

To Reproduce image image image image image

Expected behavior 它应该不依赖spring-boot-starter-web进行服务注册与服务发现

Environment

Additional context 我改完之后提交PR

DerekYRC commented 2 years ago

@beiming-tuling 服务发现可以不依赖spring-boot-starter-web,服务注册为什么不依赖spring-boot-starter-web呢?服务注册不依赖spring-boot-starter-web那监听端口是?

beiming-org commented 2 years ago

@DerekYRC 如果我的rpc框架不是feign和resttemplate,而是grpc和dubbo等等。那么我用tomcat的意义是什么呢?

beiming-org commented 2 years ago

@DerekYRC 我就没有必要引入spring-boot-starter-web这个包了对吧。

DerekYRC commented 2 years ago

@DerekYRC 如果我的rpc框架不是feign和resttemplate,而是grpc和dubbo等等。那么我用tomcat的意义是什么呢?

Get

chuntaojun commented 2 years ago

目前 spring cloud 的服务注册,是基于 spring cloud 本身提供的 web 服务的,您这里说的 如果是 grpc 或者 dubbo 的话,应该在 grpc-server & dubbo 本身完成服务注册动作,因为 spring cloud 对您的业务来说只是一个容器而已,服务的提供者是 grpc & dubbo

beiming-org commented 2 years ago

不能把服务提供者框定在tomcat对不对,如果我没有提供,你可以阻止我进行服务发现,但是你不能阻止我进行服务注册

beiming-org commented 2 years ago

@chuntaojun

chuntaojun commented 2 years ago

如果是 grpc 或者 dubbo 的话,应该在 grpc-server & dubbo 本身完成服务注册动作

SkyeBeFreeman commented 2 years ago

在 Spring Cloud 框架实现中,服务注册的行为可以由 WebServerInitializedEvent 事件触发的。如果没有引入 spring-boot-starter-web 包,则没有这个事件来触发服务注册。其他的服务提供的实现也需要给出相应的注册触发行为。