I have two proxies: A and B.
Proxy B is the "main" one, connected directly to my backend server using an HTTP Target Endpoint. However, for a given set of consumers, I would like to apply some transformations in my server's responses.
The solution that I came up with is to use the Chaining API Proxy feature of Apigee Edge. In my case, I can create a new proxy - A - that will simply forward all requests to proxy B, so that I can add a policy in its postflow steps to do the needed transformation. So far, so good.
However, by simply following the documentation, I couldn't get this to work. Here are the basepaths of both proxy B (main one) and A (wrapper one):
Proxy B: /v1/foo/bar Proxy A: /prefix/v1/foo/bar
I want all requests to be forwarded from proxy A to proxy B:
/prefix/v1/foo/bar/* → /v1/foo/bar/*
My target endpoint in proxy A looks like this:
<LocalTargetConnection> <Path>/v1/foo/bar</Path> </LocalTargetConnection>
And every request that I make to proxy A will return me an empty response. How can I debug this?
Solved! Go to Solution.
The problem was in my route. I have created my Proxy Endpoint with no target, but then its route was pointing to nowhere. As soon as I added the correct route to my default Proxy Endpoint, everything started working. Here is an example of what solved it for me:
<RouteRule name="default"> <TargetEndpoint>Proxy-B</TargetEndpoint> </RouteRule>
Hi @Ivan Reche, chaining proxies using Service Callout policy can be done in two ways.
I think you have tried the first option, by specifying the Proxy B Path. Im not sure why its not working, I will give it a try and update here.
BTW did you try the second option using the Proxy Name?
<LocalTargetConnection> <APIProxy>data-manager</APIProxy> <ProxyEndpoint>default</ProxyEndpoint> </LocalTargetConnection>
For debugging purpose, I would suggest you to start the Trace Session for both proxies, make a call & check the traces.
I tried first by name. Same results. Will try tracing now
I've used the tracing tool to no good. It shows that the client received a response 200 with an empty body. I don't see my target anywhere. Here is a screenshot of the tracing session.
I've also checked that both API Proxies use the same deployment (the docs warn that you cannot chain between different deployments).
The problem was in my route. I have created my Proxy Endpoint with no target, but then its route was pointing to nowhere. As soon as I added the correct route to my default Proxy Endpoint, everything started working. Here is an example of what solved it for me:
<RouteRule name="default"> <TargetEndpoint>Proxy-B</TargetEndpoint> </RouteRule>