ichenhe opened a new issue #2012:
URL: https://github.com/apache/incubator-shenyu/issues/2012
## Describe the bug
It seems that spring cloud dependence failed to register context path
correctly, caused the actual path that shenyu visit is very strange.
## Environment
- ShenYu version(s): 2.4.0
## Steps to reproduce
1. Add dependence to my service:
`implementation("org.apache.shenyu:shenyu-spring-boot-starter-client-springcloud:${Const.shenYuVersion}")`
2. Add properties:
```yaml
shenyu:
client:
registerType: nacos
props:
contextPath: "/"
nacosNameSpace: Shenyu
isFull: false
```
3. Add annotation to class and function.
```kotlin
@RestController
@ShenyuSpringCloudClient(path = "/users")
internal class UserController(
private val userService: UserService,
private val watchfacePermissionService: WatchfacePermissionService,
) : IUserController {
@ShenyuSpringCloudClient(path = "/hello")
override fun hello(): String {
return "Hello"
}
}
```
Then, send a request to shenyu: `http://localhost:7000/users/hello`.
## Expected behavior
Shenyu should redirect to `http://xxx.xxx.xx.xx:7010/users/hello`.
But the actual is `http://192.168.50.20:7010ers/hello`.
---
I checked the context_path's rules, there is a newly added:

After several attempts, I really can't understand the specific behavior of
this plugin —— No matter what I fill in, I can't achieve the expected behavior.
Finally, I turned off the plugin (or delete this rule) and everything was
fine.
---
So, does this tool misunderstand the path I set? Or are there other approch
for this situation where context_path is not required?
## Debug logs
```
INFO 46443 --- [ctor-http-nio-3] o.a.s.plugin.base.AbstractShenyuPlugin :
context_path selector success match , selector name :/context-path/
INFO 46443 --- [ctor-http-nio-3] o.a.s.plugin.base.AbstractShenyuPlugin :
context_path rule success match , rule name :/context-path/
INFO 46443 --- [ctor-http-nio-3] o.a.s.plugin.base.AbstractShenyuPlugin :
springCloud selector success match , selector name :/
INFO 46443 --- [ctor-http-nio-3] o.a.s.plugin.base.AbstractShenyuPlugin :
springCloud rule success match , rule name ://users/**
INFO 46443 --- [ctor-http-nio-3] o.a.s.plugin.httpclient.WebClientPlugin :
The request urlPath is http://192.168.50.20:7010ers/hello, retryTimes is 0
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]