APIGEE-API-ENGINEER practice question 10 of 25

Which is the recommended solution lo specify a different backend target for each environment?

Full set: 126 questions
Answer options
A: Java/JavaScript/Python callout
B: TargetEndpoint configuration
C: RouteRules
D: TargetServer Correct answer
Correct Answer:
D. TargetServer
Explanation

The recommended solution is to use a TargetServer configuration. TargetServers are environment-scoped objects in Apigee that decouple the concrete backend endpoint URLs from the API proxy's TargetEndpoint definition. You can define a TargetServer with the same name (e.g., 'backend-service') in each environment (dev, test, prod), but with a different host/IP address for each. The API proxy then references this named TargetServer. When the proxy is deployed to an environment, it resolves to the backend configured for that specific environment, allowing the same proxy bundle to be promoted without modification.

Why Incorrect

A. Java/JavaScript/Python callout: This is not recommended as it adds unnecessary code complexity and mixes configuration with runtime logic, making the proxy harder to maintain.
B. TargetEndpoint configuration: Hardcoding a URL directly in the TargetEndpoint is bad practice because it requires changing the proxy bundle for each environment.
C. RouteRules: RouteRules are used for conditional routing based on request characteristics (e.g., path, headers), not for managing environment-specific backend endpoints.

References

1. Google Cloud Apigee Documentation, "Load balancing across backend servers": This document explicitly states, "A TargetServer decouples concrete endpoint URLs from TargetEndpoint configurations. Instead of defining a concrete URL in your configuration, you can configure one or more named TargetServers... The TargetServer definition itself is stored in the environment..." This directly supports using TargetServer for environment-specific backends.

2. Google Cloud Apigee Documentation, "TargetEndpoint configuration reference": Under the element section, the documentation shows how to use to reference a TargetServer by name (), which is the mechanism for implementing this pattern. It contrasts this with using a direct .

3. Google Cloud Apigee Documentation, "About environments and environment groups": This document clarifies that an environment is a "runtime execution context for the API proxies" and that certain configurations, like TargetServers and Key Value Maps (KVMs), are scoped to these environments. This reinforces that TargetServer is the correct construct for environment-specific configurations.

Scroll to Top