重新等待键在get请求中缓存
我有两个休息点的
- 发布请求,此请求执行一些长期运行的任务,并填充缓存中的键值对。
- 获取请求此获取与特定密钥相对应的缓存的数据。
现在,有时甚至在POST请求完成处理之前,Spring-Boot Server即将获得GET请求,因此我想要某种方式,以便Get请求等待键在服务器中加入。如果在1秒内,键不会从get终点返回缓存的null。
任何人都可以通过一些解决方案来帮助我解决这个问题。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论