I have a proxy. How can I set up dynamic target endpoint like the followings?
Test Environment: target endpoint = https://a.mydomain.net Prod Environment: target endpoint = https://a.mydomain.com
I found arghya das already answered it. https://community.apigee.com/questions/2139/dynamic-endpoint-proxy-for-testing-and-production.html
<ProxyEndpoint name="default"> ... <RouteRule name="test"> <Condition>(environment.name = "test")</Condition> <TargetEndpoint>test</TargetEndpoint> </RouteRule> <RouteRule name="prod"> <Condition>(environment.name = "prod")</Condition> <TargetEndpoint>prod</TargetEndpoint> </RouteRule> </ProxyEndpoint>
@zono
Instead of checking environment at ProxyEndPoint as written by you above, you can configure the TargetServer environment bases and just need to use the created TargetServer alias name at TagetEndPoint.
In your code, if any changes in host, you have to do changes at proxy level and if new environment comes than again one more environnement check is required, Hence it is tightly coupled with proxy.
Creating a TargetServer at environment level is configurable and easy to manageable with much more benefits .
Taget level
<HTTPTargetConnection> <LoadBalancer> <Server name="mock-bakend"/> </LoadBalancer> </Path> </HTTPTargetConnection>
TargetServer Configuration - see the below screen
The same procedure we normally follow.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |