Logging after return statement in method && asynchronous logging

23 views Asked by At

In the web service method, we first go to Oracle. Then we log in the finally block. Since we write to elasticsearch for logging, the service method's return time is too long. We want to do the logging in the background after returning it to the user in the method. We cannot manage threads due to heavy concurrent requests. The service flow is as follows:

first flow diagram

We want the flow to be as follows in order to respond faster.

second flow diagram

How can we perform the log writing process independently without returning the data in the background? Which structure can we use? Thanks very much for your recommendations.

Developing more responsive service methods

0

There are 0 answers