apache / apisix

The Cloud-Native API Gateway
https://apisix.apache.org/blog/
Apache License 2.0
14.51k stars 2.52k forks source link

help request: upstream configuration item service_name, how to support dynamic fetching instead of fixed #10398

Open juaby opened 1 year ago

juaby commented 1 year ago

Description

upstream configuration item service_name, how to support dynamic fetching instead of fixed. For example, parsing from the tcp private protocol, or through http headers, or through http parameters $ curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d ' { "uri": "/a/", "plugins": { "proxy-rewrite" : { "regex_uri": ["^/a/(.)", "/${1}"] } }, "upstream": { "service_name": "A-SERVICE", "type": "roundrobin", "discovery_type": "eureka" } }'

$ curl http://127.0.0.1:9180/apisix/admin/routes/2 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d ' { "uri": "/b/", "plugins": { "proxy-rewrite" : { "regex_uri": ["^/b/(.)", "/${1}"] } }, "upstream": { "service_name": "B-SERVICE", "type": "roundrobin", "discovery_type": "eureka" } }'

Environment

monkeyDluffy6017 commented 11 months ago

Why do you want this?