Is service callout policy pick a reference variable from target servers

Hi Team,

I am trying to call the target server with the reference variable in the service callout policy. But getting errors like service unavailable or Host unreachable.

Here I  created a target server with a mock target endpoint(https://mocktarget.apigee.net) at environments.

Please help on this.

Solved Solved
0 3 190
1 ACCEPTED SOLUTION

What's exactly you're trying to solve for? Do you mind sharing more details, please? Without you sharing how & why you're trying to accomplish this I have to guess that you're trying to set the ServiceCallout/HTTPTargetConnection/LoadBalancer/Server name attribute using a reference variable. If that's the case, it's not possible.

One option to consider would be to set the "servicecallout.policy_name.target.url" variable, which allows you to read/write dynamically. But you won't be able to use a TargetServer with it. 

View solution in original post

3 REPLIES 3

What's exactly you're trying to solve for? Do you mind sharing more details, please? Without you sharing how & why you're trying to accomplish this I have to guess that you're trying to set the ServiceCallout/HTTPTargetConnection/LoadBalancer/Server name attribute using a reference variable. If that's the case, it's not possible.

One option to consider would be to set the "servicecallout.policy_name.target.url" variable, which allows you to read/write dynamically. But you won't be able to use a TargetServer with it. 

Thank you for your response. What I am trying to do is pick the target server through service callout policy ServiceCallout/HTTPTargetConnection/LoadBalancer/Server name attribute using this. Its working in 2021 when I am working for another project in edge cloud. Why it's not working in hybrid env?

Can you share a sample of the working policy? And you said it worked in 2021 in Apigee Edge?