I want to ask if I could configure a proxy that would redirect my incoming requests to different backend endpoints based on query param or the URL.
e.g. I have multiple customers for which I create a different instance of application in the cloud. Each instance is hosted on a separate machine with a different IP. The clients of my application would access the URL of proxy configured in Apigee and Apigee should redirect that call to appropriate instance of application. e.g. client A for application instance A would access the proxy and proxy should be able to redirect that request to application instance A. The client A might supply some parameter in the query string that would identify that the request should be routed to application instance A. Is this possible?
yes, that is possible. in fact, what you describe is a quite mainstream and common use-case for Apigee Edge among the customers I know of. I wouldn't use the term "redirection" though. I think you mean "proxy" when you say "redirect". Redirect is something an HTTP Server does to direct a client to a different address, then the client contacts that backend server directly. The best way to use Apigee Edge is not as a redirector, but as a proxy. So Apigee Edge would *proxy* the client call to a different backend.
--
Apigee Edge acts as a smart, configurable proxy. An API Proxy running in Apigee Edge can authenticate the credentials on Inbound requests - like an API Key, or an OAuth Token, or something else.
After successful authentication, the proxy will have access to information about the client, that you (the API Program manager) have associated to the client in the Apigee Edge store. This information might include:
The smart proxy can then make decisions about what to do with the authenticated request, given all that information. It could route to the specified backend. It could Route to the specified backend, and then filter or shape the response. It could enforce a quota.... Lots of options here.
The key to this is the custom attributes feature in Apigee Edge. Each client app registered in Apigee Edge gets credentials - this is an API Key (or consumer key) and a consumer secret. You can optionally associate a set of data, in key/value pair form, to each client app in Apigee Edge.
It does not matter which form of client app authentication you use. For app authentication, you can choose :
In all cases, after authentication, the smart proxy has access to the client id (also known as the "API Key", sometimes called the "consumer key", other times called the "consumer id" - these are all the same thing!). And the smart proxy also has access to any custom attributes stored with the client entity.
Then the smart proxy can route the request to an endpoint stored on the custom attributes.
Super easy. You can look at this Q&A for some further information on the technique.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |