Reputation: 160
I want to stored http request in databases and will generated response to it when required.
Is it possible to stored the http request in db and generate response to it after 1 day or more in spring boot/spring
Upvotes: 0
Views: 379
Reputation: 431
Depend on your system requirement, the server can work something like this:
Client send http request to server
Server saves http request (to DB, file, ... anything) and generate a unique request_id
. Server returns this request_id
to client.
The next day, client will need to send a new http request to server to get the response, with previous request_id
included.
Server look for saved request_id
, process it, and return response to client.
Upvotes: 0
Reputation: 512
Obviously yes. It is how you architect your system. What I could see is basically you are trying to do something on scheduled manner.
Try using @Scheduled
annotation to perform scheduled tasks.
Refer this url
Make sure to have persistent layer which stores the requests and your scheduled tasks pick it up. If it needs to communicate with different systems as call back include it as part of your task.
Upvotes: 1