apache / shenyu

Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance.
https://shenyu.apache.org/
Apache License 2.0
8.43k stars 2.93k forks source link

[BUG] why contextpath "/springcloud" != "springcloud" ? #3350

Closed ZZQ001010 closed 2 years ago

ZZQ001010 commented 2 years ago

Is there an existing issue for this?

Current Behavior

image

Expected Behavior

can be proxied through the gateway

Steps To Reproduce

  1. I use springcloud + shenyu, the registry uses consul. This is the configuration of my microservice
    shenyu:
    register:
    registerType: http
    serverLists: http://localhost:9095
    props:
      username: admin
      password: 123456
    client:
    springCloud:
      props:
        contextPath: ${spring.application.name}
  2. no "/" image
  3. no match image
  4. not the expected result

Environment

ShenYu version(s): master

Debug logs

No response

Anything else?

I think "/" should be automatically filled when registering the api

loongs-zhang commented 2 years ago

Did you enable the springCloud plugin on the admin ?

loongs-zhang commented 2 years ago

see https://shenyu.apache.org/docs/next/quick-start/quick-start-springcloud/ image

loongs-zhang commented 2 years ago

and try with contextPath: /${spring.application.name}

ZZQ001010 commented 2 years ago

I think "/" should be automatically filled when registering the api

loongs-zhang commented 2 years ago

@zzq1314zll can you provide this new feature? Maybe other plugin also needs this, it's recommend to change it in client.

loongs-zhang commented 2 years ago

see https://github.com/apache/incubator-shenyu/pull/3430 , please close this issue if you are sure @zzq1314zll