Wait time in account aggregation before trying another API call

Hi ,

I am using an asynchronous web service to do account aggregation.
In the first API call, I am getting a unique id in response which I am using to fetch all the users in my second API call body.

The issue is on running account aggregation it is running both the API but the second API response will not have any data as it is still processing but will give 200 responses.
It takes at least 2 mins to populate the data.
If I run the aggregation again it will generate a new unique id in response to the first API and will be used again in the second API (which will give the same result as no user data ).

Is there any way we can provide a wait time between two APIs so can give time for the second API to process the data and bring it in response?

Hi Varun,
Welcome to the community.
Are you using 2 HTTP operations for this? We had a similar situation and what we did was to get the SessionID (Probably similar to UniqueID in your case) in the BeforeOperation Rule and update the header of the Account Aggregation operation. And, when the data size is larger than what is fetched in one request, use pagination

2 Likes

Hi Varun,
I am not sure I entirely understand your requirement.
By Second API, do you mean second Aggregation Operation call?
If the second API response is delayed, why would you want to wait before the second API?
If the response you are getting in second API is “in progress” how do you get the data after 5 mins? Do you have to run the same API again?

As your second API is giving a response in varied number of minutes, there is no straightforward solution. You can try increasing the connector timeout (try increasing both healthCheckTimeout and timeoutInSeconds to 300 or more in your WS application) , but that might not be proper solution for future if the app data grows exponentially or data fetch starts taking more and more time - which will lead to increased aggregation timings. Also make sure you handle any pagination logic if any.

Thats why for such scenarios best solution is to have an Enterprise Integration platform like MuleSoft in between, wherein IDN fetches the data for this application from MuleSoft endpoint and MuleSoft handles async response.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.