I am developing a web API for an application. I had got a situation where the user will send a few data to my API. After processing the data I have to forward a few data to other API.
But I don't want to concentrate on the response from the second API to where I had called.
After calling the second API I want to send my response to the user without waiting for the second API response. Can anyone tell me how to handle this situation?
My API is written in JAVA spring boot REST, The Second API to where am calling is in PYTHON.
@Async
will make it execute in a separate thread, i.e. the caller will not wait for the completion of the called method.Example: Spring Doc, Example 1, Example 2