Open topcatv opened 2 months ago
hi, the IpUtils.isCompleteHost
method is for checking whether the host is complete, and it actually just support ip now
Whether to consider supporting hostname or service name of k8s service
Whether to consider supporting hostname or service name of k8s service
我也发现了这个问题,然后我用多语言的http客户端用调接口的方式倒可以用hostname,不知道是设计问题还是什么,也能实现正常转发 https://shenyu.apache.org/zh/docs/developer/developer-shenyu-client
I also discovered this issue, and then I used a multilingual HTTP client to call the interface using hostname. I don't know if it's a design problem or something, but I can still achieve normal forwarding
😄
hi, we will discuss thia problem later, and may solve this problem in next version
Question
When using shenyu-spring-boot-starter-client-springmvc, I want the host registered with the gateway to be the hostname that I specify. How can I achieve this? Because I used the service in k8s to provide services, therefore I used the following configuration in the configuration file.
However, after registering to the gateway, it was found that the upstream of the divide was still the IP address of this service instead of the service name. Through source code analysis, it was found in the
org.apache.shenyu.client.springmvc.init.SpringMvcClientEventListener#buildURIRegisterDTO
methodIpUtils.isCompleteHost(this.host)
returns false, so the host IP will be fetched. Can this be changed here to support configuring the host name or svc in k8s?