我已经发布了项目
https://github.com/armdev/ignite-spring-boot
使用Spring数据JPA,Mysql和Apache Ignite配置 .
这是Ignite缓存配置
@Bean
public Ignite igniteInstance() {
IgniteConfiguration cfg = new IgniteConfiguration();
// Setting some custom name for the node.
cfg.setIgniteInstanceName("springDataNode");
// Enabling peer-class loading feature.
cfg.setPeerClassLoadingEnabled(true);
// Defining and creating a new cache to be used by Ignite Spring Data
// repository.
CacheConfiguration ccfg = new CacheConfiguration("FlightCache");
// Setting SQL schema for the cache.
ccfg.setIndexedTypes(Long.class, Flight.class);
cfg.setActiveOnStart(true);
cfg.setCacheConfiguration(ccfg);
return Ignition.start(cfg);
}
Project有2个API,一个没有Ignite,但是使用Ignite配置的存储库不起作用 . 我不明白理由 .
1 回答
您需要配置一个将在MySQL数据源之上运行的CacheStore . 您还需要启用write-through and read-through行为 .