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

Shenyu as a traffic gateway #4025

Closed hlcen66 closed 2 years ago

hlcen66 commented 2 years ago

Question

Hello, if I take Shenyu as a company level traffic gateway to forward requests to spring cloud gateway gateways of multiple downstream systems, can Shenyu support it?

like this:

image

hlcen66 commented 2 years ago

@yu199195 @yunlongn @moremind

yunlongn commented 2 years ago

admin add forwarding routes

hlcen66 commented 2 years ago

admin add forwarding routes

How to configure forwarding routes? the forwarding routes mean selector and rule ? it base on plugin ,but the spring cloud gateway can not resigtry to the shenyu。

Which proxy should I go to to configure the selector and rule?

i dont understand , Can you show me a screenshot ?

yunlongn commented 2 years ago

admin add forwarding routes

How to configure forwarding routes? the forwarding routes mean selector and rule ? it base on plugin ,but the spring cloud gateway can not resigtry to the shenyu。

Which proxy should I go to to configure the selector and rule?

i dont understand , Can you show me a screenshot ?

https://shenyu.apache.org/zh/docs/next/user-guide/admin-usage/selector-and-rule

moremind commented 2 years ago

first, why do you design? and if you can read shenyu document on https://shenyu.apache.org/docs/index/, you can use divide or springcloud plugin.

yunlongn commented 2 years ago

If your spring cloud gateway is registered with eureka, then you can use Proxy/springCloud to connect to it , new Selector

hlcen66 commented 2 years ago

If your spring cloud gateway is registered with eureka, then you can use Proxy/springCloud to connect to it , new Selector

i had try, the spring cloud gateway as a spring cloud service can registry into the shenyu ,but a new problem produce.. image

cloud gateway config : image

so , the url by shenyu proxy is : http://localhost:9195/springcloud/order-server/order/list

but the gateway route url can not be a metadata .

when i ask url : http://localhost:9195/springcloud/order-server/order/list

the debug result: image

image

so,how to forward the request to the gateway through shenyu, can you give me a demo? pls ,thanks

hlcen66 commented 2 years ago

@moremind @yunlongn @yu199195

yunlongn commented 2 years ago

@moremind @yunlongn @yu199195

you can add my wechat: liyunlongn

yunlongn commented 2 years ago

Please enable the spring cloud plugin and use the spring cloud proxy method

hlcen66 commented 2 years ago

Please enable the spring cloud plugin and use the spring cloud proxy method 1:spring cloud plugin had enable 2:the gateway can not use @ShenyuSpringCloudClient, how i use the proxy

you can write a cloud gateway registry into shenyu ,and user spring cloud proxy method to ask gateway's route url ,it can not work.