Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

非Web SpringBoot 实例信息端口获取问题 #333

Open
applenele opened this issue Sep 21, 2023 · 4 comments
Open

非Web SpringBoot 实例信息端口获取问题 #333

applenele opened this issue Sep 21, 2023 · 4 comments
Labels
question Further information is requested

Comments

@applenele
Copy link

applenele commented Sep 21, 2023

我们有非web Springboot应用,专门提供dubbo服务。启了dubbo端口。但是并不需要启一个web端口。
Springboot 启动代码如下
image

这里获取的实例信息如下
image

查看获取实例信息的代码如下。此时server.port 虽然有值(默认8080),但是实际上没有启这个端口。
image

@applenele applenele added the question Further information is requested label Sep 21, 2023
@KamToHung
Copy link
Collaborator

服务启动是spring-boot-starter-web启动吗

@applenele
Copy link
Author

服务启动是spring-boot-starter-web启动吗

不是,没有引入web的starter

@KamToHung
Copy link
Collaborator

服务启动是spring-boot-starter-web启动吗

不是,没有引入web的starter

可以自己设置server.port,从server.port获取

@yanhom1314
Copy link
Collaborator

yanhom1314 commented Sep 22, 2023

本质就是个ip:port组合做服务实例的唯一标识,可以自己设置server.port有必要的话

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants