Explain spring cloud hyperstrix request cache in detail

Hystrix supports caching the results of one request, and the next request with the same key will directly fetch the results from the cache to reduce the request overhead. To use this function, you must manage the hystrixrequestcontext. If request B needs to use the result cache of request a, a and B must be in the same context. Through hystrixrequestcontext Initializecontext() and context Shutdown () can build a context. All requests between these two statements are in the same context. Of course, this management process can be implemented through a custom filter. Refer to the previous article https://www.oudahe.com/p/54017/

For the complete code, please refer to: https://github.com/jingangwang/micro-service

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>