Send the client (request) headers to the routing server

Not applicable

Hi, I have a requirement to route the requests to the routing server if I got 503 response from the target server (when target server is not available). Based on the conditional routing, I'm using Java Callout policy for routing. The client request is going to the routing server but the actual headers of client is not going even though I'm using request.retain.headers.enabled is true. Please advice how I can achieve this. Thanks!

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ServiceCallout async="false" continueOnError="false" enabled="true" name="MaintenancePolicy"> <DisplayName>MaintenancePolicy</DisplayName>

<FaultRules/>

<Properties/>

<Request clearPayload="true" variable="myRequest">

<!--<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>-->

</Request>

<Response>calloutResponse</Response>

<HTTPTargetConnection>

<Properties>

<Property name="request.header.X-Async">true</Property>

<Property name="request.retain.headers.enabled">true</Property>

<Property name="request.streaming.enabled">true</Property>

<Property name="response.streaming.enabled">true</Property>

</Properties>

<URL>https://abc-test.apigee.net/</URL>

</HTTPTargetConnection>

</ServiceCallout>

0 1 511
1 REPLY 1

Not applicable

@swapna I think the configuration Request clearPayload="true" is clearing the entire request sent last time to the backend which includes the headers. Try removing that or setting that to false (it is false by default). If there is QP and payload sent to the one which gave back a 503 and you do not want that to be sent on a retry(routing), then you will need to explictly set that in the service callout.

I would normally capture things like header etc which I want to reference in other policies into a variable and then set the reference to that in the service callout to keep it clean.

I hope this helps!