I tried reading the target.url variable in the request of target endpoint preflow but it's not getting read.
Assign message policy trace --
Please help me here .
What is your goal? Setting the target.url variable will override what is configured in the TargetEndpoint configuration . I am not sure that READING the target.url before the target is contacted, will give you what you want.
What is your goal?
I am trying to capture it in response as well after the target server responds. Still I don't see it populating. I want to capture that variable as part of logging.
Are you using an HTTPTargetConnection in your target? (There are multiple different kinds of target).Are you using load balancing?
Can you show the config of your Target?
Try this. Attach an AssignMessage policy in the Target Response PostFlow. configure it like this:
<AssignMessage name="AM-Diagnostics">
<AssignVariable>
<Name>diags</Name>
<Ref>target.url</Ref>
</AssignVariable>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</AssignMessage>
In the Trace you should see the value of target.url being assigned to the variable "diags".
Target Endpoint given below:
The Assign Message you suggested was used as you had suggested and also this variable was read in post proxy flow hook but still it resolved to empty:
yes, using a LoadBalancer means you will not be able to directly read the target.url
variable.
Try reading loadbalancer.targetserver
. See the documentation.
Using the variable load balancing.targetserver gives me just the server name i.e. cloudrun-service-2
Is there any way or variable to get the whole url which is called by the Apigee.
I think
target.url
variable does not provide this information. (internal ref b/285446621)User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |