My Springboot application needs to consume a /lookup REST service to get dropdown list data based on an identifier sent in request body. For example - 1st lookup call send "identifer" : "country" --> get list of all available countries. 2nd call send "identiifer" : "employees" --> get list of all employees" like this I have almost 20 identifier for which same /lookup service needs to use to get their corresponding response.
Question - Requirement is to write single rest service and dynamically send all identifiers in the request body to lookup service and have results cached in memory and make it available at server startup so that the data are available to display on UI dropdown on page load lazy loading and no need to hit service each time to get the dropdown values first time on page load.This is to improve the application performance. Could you please guide me efficient way to handle this pls?
My thought is I will need make async call for parallel thread to send all these 20 request to same service by passing different request identifier in the body.pls let me know if my thought is correct on this?
For cache implementation, Iam completely new to this and not sure how to make the rest api response (tht we get from another rest api) available at springboot application server startup. pls help me on this.