It does seem very simple to add multiple ApiProxies. However, I am looking for the correct architecture to connect them. I could imagine having 5-10 ApiProxies and needing to connect 1, 2 or 3 of them to get real business value. For example, imagine that I have
3 ApiProxies (aProxy, bProxy and cProxy).
3 use cases
case1: call aProxy alone and return the results to the caller
case2: call aProxy; extract 2 fields from the response; call bProxy with the 2 fields; and return the results to the caller
case3: call aProxy; extract 2 fields from the response; call bProxy with the 2 fields; extract 1 field from the response; call cProxy with the 1 field; and return the results to the caller
What is the recommended approach to stitch these together? Do I create the three ApiProxies (aProxy, bProxy, cProxy); and then
create two additional ApiProxies (case2, case3) that connects the other ApiProxies using chainedProxy (but I did not see how to chain 3 ApiProxies together)
create two FlowCalloutProxies (case 2, case) that connects the other ApiProxies
other?
Any help would be appreciated.
James
The number of proxies depends on your business case and the resources you have.
Ideally speaking the scenario you presented makes sense and can be used. There is no need to create additional proxies to connect other proxies. For proxy chaining, you can have a look at this doc,
https://docs.apigee.com/api-platform/fundamentals/connecting-proxies-other-proxies
In some Apigee Pricing Plans, there is a limit on the number of proxies, in these cases, we can make use of Service Callout and other policies to call multiple target endpoints within a single proxy instead of multiple proxies.
https://docs.apigee.com/api-platform/reference/policies/service-callout-policy
Service Callout policy can be used to call both external REST APIs and local API proxies. Check the docs for more info.
What you are looking for is mashup of APIs. You could do that with javascript httpclients or service callouts.
You can look at some samples -
https://github.com/apigee/api-platform-samples/tree/master/doc-samples/policy-mashup-cookbook
https://github.com/apigee/api-platform-samples/tree/master/doc-samples/javascript-mashup-cookbook
Here's the reference to the docs -
https://docs.apigee.com/api-platform/samples/cookbook/using-policy-composition
User | Count |
---|---|
7 | |
2 | |
2 | |
1 | |
1 |