accessing X-Apigee request header within RouteRule condition

Not applicable

I'm in the unfortunate but thankfully temporary position of needing to select a target endpoint based on the location of the apigee rmp. I see various X-Apigee headers in the trace view, but I'm unable to access them via 'request.header.foo' as shown in the following snippet:

<RouteRule name="sv2">

<Condition>(environment.name = "somenv") and (request.header.X-Apigee.router.host Matches "*somedc*")</Condition>

<TargetEndpoint>somedc</TargetEndpoint>

</RouteRule>

Has anyone had any success at accessing X-Apigee headers via a condition?

0 1 346
1 REPLY 1

There is a messageid flow variable.

http://docs.apigee.com/api-services/reference/variables-reference

Holds the globally unique ID for the request, which includes the router host name. This ID allows requests received at the router to be tracked after they are sent to the message processor.

Hope you are not on the cloud instance. If you are, there are no guarantees that the router host would remain the same.

I would recommend using the MP's IP address and an external load balancer to do the geo-routing that you seem to hint.

Please add more details on other options you considered.