Hi, I'm looking for an example of the scatter gather pattern. Is there a policy to do that?
basically.
- endpoint that internally calls 2 endpoints concurrently.
- it waits till all the responses are fulfilled.
- then you put together something based on response1 and response 2.
Solved! Go to Solution.
Hi @Esteban Lartigue, I am sure you are coming from Mule Anypoint Studio Scatter Gather Connector which takes an input & makes two or more concurrent calls & then use a Transformers to flatten both payloads.
In Apigee we don't have an out of the box policy for that, but we can do that using a couple of Service Callout policy(synchronous in nature) or use Nodejs/Java custom code.
Hi @Esteban Lartigue, I am sure you are coming from Mule Anypoint Studio Scatter Gather Connector which takes an input & makes two or more concurrent calls & then use a Transformers to flatten both payloads.
In Apigee we don't have an out of the box policy for that, but we can do that using a couple of Service Callout policy(synchronous in nature) or use Nodejs/Java custom code.
thanks! @Siddharth Barahalikar, is there an example somewhere on the NodeJs/Java custom code?
I'm starting a new project and I'm outlining the things I want to be able to do investigate before I actually need to do it. so I can work towards then in my free time.
Definitely not a need right now, but I totally see this becoming a need at some point.
We can use an Javascript Policy for async http calls. Please refer below docs,
https://community.apigee.com/articles/2340/asynchronous-http-requests-in-an-api-proxy.html
thank you. i definitely come back to this when performance comes back to me, and combine it probably with caching.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |