APIGEE-API-ENGINEER practice question 8 of 25

While testing your Apigee API proxy, you discover that the TargetEndpomt that is called is not what you expect. You have verified that there is a RouteRule that matches conditions, and should be called. What should you do?

Full set: 126 questions
Answer options
A: Modify the RouteRuies to be more specific.
B: Create a new proxy for this special condition.
C: Reorder the RouteRuies so that your condition is found Correct answer
D: Add a new TargetServer to handle your specific condition
Correct Answer:
C. Reorder the RouteRuies so that your condition is found
Explanation

Apigee evaluates RouteRules within a ProxyEndpoint sequentially from top to bottom. The first RouteRule whose condition evaluates to true is executed, and all subsequent RouteRules are ignored for that transaction. The issue described occurs when a more general RouteRule is placed before a more specific one. If an incoming request matches the conditions of both, the general rule will be executed first, preventing the proxy from ever evaluating the intended specific rule. Reordering the rules to place the most specific conditions first ensures they are evaluated and executed correctly.

Why Incorrect

A. Modify the RouteRules to be more specific. This is incorrect because the problem is not the specificity of the rule itself, but its position in the evaluation order. A matching rule already exists.
B. Create a new proxy for this special condition. This is an inefficient solution and an anti-pattern. RouteRules are designed specifically to handle conditional routing within a single API proxy.
D. Add a new TargetServer to handle your specific condition. This is incorrect because a TargetServer defines a backend instance. The problem lies in the routing logic (RouteRule) that selects a TargetEndpoint, not the backend server configuration itself.

References

1. Google Cloud Apigee Documentation

"Conditional routing":

Under the section "Conditional routing

" the documentation states: "Apigee evaluates the conditions in the order they are defined in the ProxyEndpoint configuration. The first route whose condition evaluates to true is executed." This directly supports the explanation that order matters and the first match wins.

2. Google Cloud Apigee Documentation

"API proxy configuration reference":

In the section describing the ProxyEndpoint configuration

the RouteRule element is detailed. The documentation on processing multiple rules implicitly confirms their sequential evaluation. The examples show a default (no-condition) rule placed last

which is best practice

reinforcing the concept of ordered evaluation where specific rules must come before general or default rules.

Scroll to Top