So this is more of a Integration Design approach question, using Middleware system
I am working on a requirement, to fetch data from multiple APIs from an external system and display it on a LWC Card on a Console Page.
So the card, for example needs to perform 6 different GET calls to display data on Salesforce record page in a single LWC card. We have Mulesoft as the middleware.
In my opinion Middleware needs to perform all the calls and return one consolidated response, which will reduce outbound calls in a single transaction and subsequently have a reduced response time.
But, the Middleware is being built based on single API approach, for example:
- Get Billing Info - Is one API to be exposed
- Get Financial Info - is one more API to be exposed.
- Get Account Info - is another API to be exposed.
So that multiple systems can access the APIs and it is not restricted to salesforce requirement alone.
Salesforce needs to display data from both APIs together, so as per my understanding middleware team should expose a 3rd API which would provide data from both individual endpoints.
Salesforce will also be using the APIs on individual basis(like, I want to view only Financial Info) on some other screens
I have gone through the Integration Patterns and Practices document and have a strong opinion on having a single call in one transaction and Middleware performing other calls
Taking into consideration, that middleware will be used by multiple systems and this is a Salesforce specific requirement, wanted to understand, what is a better approach.
Whether to have multiple callouts in same transaction for displaying multiple API data or to perform a single callout?