如何在请求流中强制响应跳过目标端点

时间:2014-10-13 19:31:19

标签: apigee

在Apigee EDGE API代理中,在处理API代理请求流中的策略时,如何强制流转到响应流并跳过将请求发送到目标服务,而不使用引发故障策略或ResponseCache政策??

1 个答案:

答案 0 :(得分:0)

您可以使用没有TargetEndpoint值的RouteRule。如果要绕过目标服务,请选择匹配的条件。 RouteRules按从上到下的顺序进行评估,并选择第一个条件匹配。

<RouteRule name="noTarget">
    <Condition>skipTarget = true</Condition>
    <!-- no target endpoint -->
</RouteRule>
<RouteRule name="default">
    <!-- no condition, so this one always matches -->
    <TargetEndpoint>default</TargetEndpoint>
</RouteRule>

有关详细信息,请参阅this link