Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Using flow variables in the Path of LocalTargetConnection of a Target Endpoint

Not applicable

Hi,

I'm trying to implement a local proxy-chaining mechanism between my Proxy API's. To do so I wrote a JS policy that resolves the new path and sets it to a new variable:

context.setVariable("routePath",routePath);

then I set a RouteRule in the proxy's request pre-flow:

    <RouteRule name="re-route">
        <Condition>request.header.re-route is true</Condition>
        <TargetEndpoint>re-route</TargetEndpoint>
    </RouteRule>

and my Target endpoint is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="re-route">
    <Description/>
    <FaultRules/>
    <PreFlow name="PreFlow">
        <Request/>
        <Response/>
    </PreFlow>
    <PostFlow name="PostFlow">
        <Request/>
        <Response/>
    </PostFlow>
    <Flows/>
    <LocalTargetConnection>
        <Path>{routePath}</Path>
    </LocalTargetConnection>
</TargetEndpoint>

The thing is, when I try to use routePath variable inside the LocalTargetConnection's Path I get a deployment error from Apigee.

Why can't Apigee evaluate my variable and re-route the request accordingly? Am I missing something?

1 2 887
2 REPLIES 2