Set LocalTargetConnection dynamically in ServiceCallout

gustyheart
Participant I

am working on implantation that requires a dynamic configuration of the local target proxy path in <LocalTargetConnection> element. All approaches of the dynamic assignment of URL that I found for ServiceCallout focus on HTTPTargetConnection element, of which I m trying to avoid due to its overheads and the delay it might cause calling the proxy via target.url. When I try to set the path in:

<LocalTargetConnection>

<Path>{newReq.myProxy.path}</Path>

</LocalTargetConnection>

I get an deployment error " messaging.adaptors.http.configuration.MalformedTargetUrl".

Note: I can't use the pair <APIProxy> and <ProxyEndpoint> because I have everytime to hit different proxy and different flow within the proxy.

0 4 464
4 REPLIES 4

Try the solution given by Dino here .

@Brendan Thank you for your answer. The proxy I am using is "No Target" proxy and the solution given by @Dino works for only Target Proxy. I have to do some work to specify the path in the proxy chaining dynamically, but without calling the local proxy as an external service.

I have not seen the solution provided by Dino.

But using Service callout policy in a No target proxy is an Anti-Pattern

Using service callouts to invoke a backend service in an API proxy with no routes to a target endpoint is technically feasible, but results in the loss of analytics data about the performance of the external service.

https://docs.apigee.com/api-platform/antipatterns/service-callout-no-target