apache / apache/incubator-seata

namingServer转发请求到seata-server:v2.6.0

Open
#8,110 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

### Check Ahead

- [x] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.

- [ ] I am willing to try to fix this bug myself.

### Ⅰ. Issue Description

seata-server项目已经除了web依赖了。但是部署namingServer后访问console发现其会转发请求到seata-server

### Ⅱ. Describe what happened
部署namingServer后,完成console登录后进入console首页,其首页会请求/api/v1/console/globalSession/query,而该接口的处理代码在seata-server,所以namingServer会转发请求到seata-server。

seata-server里的server.port=8091到底是干什么用的,我发现namingServer会转发上述请求到这个端口。根据[7619](https://github.com/apache/incubator-seata/discussions/7619),已配置:
```
spring:
application:
name: seata-server
main:
web-application-type: none
```
namingServer转发请求到这个端口会出错,因为没有对应的服务来做处理。

### Ⅲ. Describe what you expected to happen

_No response_

### Ⅳ. How to reproduce it (as minimally and precisely as possible)

**这个转发错误发生条件为:**`server.port`和`seata.server.service-port`同时设置(其中`server.port`必须设置否则会报错),虽然`seata-server`此时监听`seata.server.service-port`端口,但是`namingServer`获取到的`seata-server`端口为`server.port`,此时请求将会被转发到`server.port`,而不是`seata.server.service-port`

### Ⅴ. Anything else we need to know?

_No response_

### Ⅵ. Environment

我使用namingServer的版本:apache/seata-naming-server:2.6.0.jdk25

Contributor guide

Open the contributing guide

Research direction

Reproduce the deployment with server.port and seata.server.service-port both set, then trace the /api/v1/console/globalSession/query request from namingServer to the seata-server service. Read the server.port and service-port configuration handling and compare the advertised port with the listening port; done means the console request is routed to the endpoint that actually handles it or the invalid configuration is clearly rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.