[英]Hazelcast + Spring Boot + Cache Manager
I'm trying to create an instance of Hazelcast client but I can't Override the Cache Manager implementation from Spring. 我正在尝试创建Hazelcast客户端的实例,但无法覆盖Spring的Cache Manager实现。 I don't want to use a hazelcast.xml (so, I'm in a spring boot application).
我不想使用hazelcast.xml(因此,我在Spring Boot应用程序中)。 There is a way to do it?
有办法吗?
Follow my test: 按照我的测试:
@Bean
CacheManager cacheManager() {
return new HazelcastCacheManager();
}
I've read many tutorials talking about this kind of implementation but this not work on Hazelcast v 3.8.1 我已经阅读过许多关于这种实现的教程,但是在Hazelcast v 3.8.1上不起作用
The HazelcastCacheManager.java is an Interface not a class, so I cant initialize the interface like this... (...java basic). HazelcastCacheManager.java是一个接口,而不是一个类,所以我不能像这样初始化接口...(... java基本)。
Thanks. 谢谢。
There are two identically named objects 有两个名称相同的对象
http://docs.hazelcast.org/docs/3.8/javadoc/com/hazelcast/cache/HazelcastCacheManager.html is an interface. http://docs.hazelcast.org/docs/3.8/javadoc/com/hazelcast/cache/HazelcastCacheManager.html是一个界面。
http://docs.hazelcast.org/docs/3.8/javadoc/com/hazelcast/spring/cache/HazelcastCacheManager.html is a class http://docs.hazelcast.org/docs/3.8/javadoc/com/hazelcast/spring/cache/HazelcastCacheManager.html是一个类
This example https://github.com/hazelcast/hazelcast-code-samples/tree/master/hazelcast-integration/springboot-caching is probably a good one to follow. 这个示例https://github.com/hazelcast/hazelcast-code-samples/tree/master/hazelcast-integration/springboot-caching可能是一个很好的例子。 Just add
hazelcast.version
to the maven properties to convent to 3.8.1. 只需将
hazelcast.version
添加到maven属性即可将其转换为3.8.1。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.