I have one spring integration application. It has various channels, transformers, routers and service activators configured.
Requirement
Whenever any service activators will be called, the request and response should be persisted.
Solution:
I have written one interceptor to intercept all the required channels. then based on the configuration all the required requests and responses are getting persisted in DB.
Problem with above approach
Whenever I restart my application server, 1st time it is taking too much time to initialize database configuration. second problem is whenever persistence logic is getting executed, flow is on wait state.
so, it is taking time to provide the response.
Guidance I am looking to make persistence asynchronously.
Is there any way to achieve the same? should I implement threading for persistence implementation?
Any help would be appreciated.
Thanks.