I have a use case where the internal version of a proxy has changed but the client URL remains the same .So now in apigee edge i have two proxies with same Name but different Back end Points .Can i use a header to make the client url land on specific proxy .
To give you more info,in the back-end i have now two java files now and @path annotation is different (as mentioned as different backend points)
I’m trying to understand why do we need to have 2 proxies, we can have single proxies with 2 target endpoint. Internally we can check some header/variable value(provided by consumer) and accordingly redirect it to appropriate endpoint. Let me know your thought on this.
I’m trying to understand why do we need to have 2 proxies, we can have single proxies with 2 target endpoint. Internally we can check some header/variable value(provided by consumer) and accordingly redirect it to appropriate endpoint. Let me know your thought on this.
You cannot use a parameter to make the request land on a specific proxy.Proxies are identified by base path .You can have two proxies with same name but different base path (best practice is to have different names for each proxy).If the use case is to select two different back ends based on header parameter then you can do that in a javascript policy to over write the “target.url” parameter based on your condition.
Conditional targets should solve this problem if I understand you correctly. Read the section on conditional targets in the documentation here http://docs.apigee.com/api-services/content/understanding-routes. There is an example included for routing based on header.
Conditional targets
The tag lets you direct a request to a target based on a condition. You can use flow variables, query parameters, HTTP headers, message content, or contextual information such time of day and locale to determine the target endpoint. For example, you might include a geographical area, such as US and UK, in a request URL. You can then route a request to a target endpoint based on the region.
Consider this as a case where the proxy has a minor version upgrade and not a major version upgrade . The client end url will remain the same ,though i have two proxies with different backend points . The reason for creating a second proxy in minor upgrade is for creating different swagger UI for two proxies.
The CLient URL i.e. the consumer trying to access the proxy should be same for both the URL.
If all the above three point are correct and then the solution to this is use one VHOST for one proxy and diferent VHOST for other proxy.
One DOMANIN name can point to more than one VHOST.
But in the VHOST , give different ports. i.e. one vhost provide say 1243 port and other vhost provide 1244 port. Rest all configuration for vhost can be same.
If you have the proxies with different base path and you want to give the same URL to the client and if you want to route to the proxies based on the header value, then we can create another proxy with the base URL you want provide it to the client and create 2 targets. 1st target server should point to the 1st proxy and 2nd target server should point to the 2nd proxy.
Have 2 route rules and have condition for them in such a way that they should to hit the target based on the header values.