问题
I have an existing API proxy in my organization which I want to call in my other API proxy.
Is there any other way to implement this?
One of the considerations in the API proxy development and design is not to implement ServiceCallout from one API proxy to another in the same organization, or recursively from an API proxy back to itself as indicated in the documentation.
回答1:
You can call one API proxy in other like any other request.
But i believe this is not something recommended as this would make a separate request call. what i suggest is to create a new flow within the same API proxy itself and copy the flow and policies in the other proxy to the new flow that you have created. By doing this you are just creating a new execution flow. (Which is faster and efficient but with some redundancy)
回答2:
As you say, it is not recommended to call an API Proxy from a service callout of another API Proxy because the system is not designed for this, and it will not perform well.
However you can share common resources among API Proxies. By resources, I mean java, JavaScript, XSLT, etc. This is achieved by storing these common resources at your organization level (or even at your environment level), and then referencing them in each proxy. I'm not sure if this really helps your situation or not.
来源:https://stackoverflow.com/questions/22499350/call-another-api-proxy-from-one-api-proxy-in-the-same-organization