If you are part of our SE or CS team, you would have heard of the term “proxy chaining” a lot in the last few months. Apigee Edge finally supports proxy chaining in an attempt to optimise the network route for target endpoints, which are nothing but api proxies running on Edge.
Let’s take a very simple example. Let’s say I have 2 api proxies both deployed to my org “edge” in the “test” environment. Let’s call these two proxies as apigee-proxy and apigee-target. Following are the proxy endpoints for these two api proxies:
apigee-proxy: [http://apigee-edge-test.apigee.net/apigee/proxy](http://apigee-edge-test.apigee.net/apigee/proxy)
apigee-target: [http://apigee-edge-test.apigee.net/apigee/target](http://apigee-edge-test.apigee.net/apigee/target)
The target endpoint for apigee-proxy is the proxy endpoint of apigee-target api proxy. In the current version of Edge, if we have to reference the target we would do something like:
<HTTPTargetConnection>
<URL>http://apigee-edge-test.apigee.net/apigee/target</URL>
</HTTPTargetConnection>
where apigee-edge-test.apigee.net is my virtual host alias and /apigee/target is the base path of apigee-target api proxy.
What this means is an extra network hop, because the request has to be router through ELB>Router>MP runtime path, just like any other api proxy call. With proxy-chaining, you should be able to reference the target endpoint locally, without having to make that extra hop. This would require slight changes to the apigee-proxy api though, which is as follows:
<!--
<HTTPTargetConnection>
<URL>http://apigee-func-test.e2e.apigee.net/apigee/target</URL>
</HTTPTargetConnection>
-->
<LocalTargetConnection>
<APIProxy>apigee-target</APIProxy>
<ProxyEndpoint>default</ProxyEndpoint>
</LocalTargetConnection>
So instead of specifying the proxy endpoint as the URL for HTTPTargetConnection, you define something called LocalTargetConnection with the following elements:
APIProxy: Api proxy name that you want to reference in the local target connection
ProxyEndpoint: Proxy Endpoint name that you want to be reference as the target.
These 2 would let you uniquely identify the target and allow the request to be router locally to that target. Instead of Api proxy name and Proxy Endpoint, you can also specify base path like below:
<LocalTargetConnection>
<Path>/apigee/target</Path>
</LocalTargetConnection>
This would essentially make a http call to http://localhost:8998/apigee/target the the message-processor not go through the ELB>Router>MP route thus optimising the target endpoint routing.
I am attaching the same api proxy bundles so that folks can start playing around it and give some great feedback on the feature. Remember this feature is still an “internal beta” and we haven’t published it officially. This feature is currently available in the E2E planet but would soon be available in enterprise cloud, once the 150930 release is pushed out. We need to figure out a few things like validation cases, accounting for proxy calls in analytics, target flow variables when local target reference is used, trace UI etc. before making it official. Any feedback would only allow us to improve this feature further and make it a real value proposition for our customers.