I have two REST end-points
- POST request, this request does some long running task and fills the key-value pair in the cache.
- GET request this gets the data from the cache corresponding to a particular key.
Now sometimes Spring-boot server gets the GET request even before the post request has finished processing, so I want some way such that the GET request waits for the key to get cached in the server. If within 1-second the key does not get cached null is returned from the GET end point.
Can anyone please help me with some solution or a way to solve this problem.