Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

想要针对缓存失效、缓存更新的事件做一些额外的定制应当如何扩展? #303

Closed
fxfh0504 opened this issue May 20, 2019 · 5 comments

Comments

@fxfh0504
Copy link

RT

@areyouok
Copy link
Collaborator

参考CacheContext类的buildCache方法,覆盖这个方法(或buildLocal、buildRemote),在这里可以把CacheMonitor注入进去。

@areyouok
Copy link
Collaborator

2.6.0.M3以后这个定制有简化,在spring context中提供一个自己的CacheMonitorManager(可继承DefaultCacheMonitorManager,复用一些方法)或CacheMessagePublisher都可以。

@Luomeng1004
Copy link

@areyouok 监听到消息的PUT和REMOVE,如何删除本地缓存中对应key的数据呢?我看删除的话,又会触发事件,导致循环处理。

@areyouok
Copy link
Collaborator

@areyouok 监听到消息的PUT和REMOVE,如何删除本地缓存中对应key的数据呢?我看删除的话,又会触发事件,导致循环处理。

现在没有提供默认实现,如果自己处理的话这个还有点麻烦,我想想怎么搞吧。

@gang0713
Copy link

这个问题在2.6.0里有解决吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants