【发布时间】:2018-04-14 18:59:18
【问题描述】:
我已经发布了项目
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);
}
项目有 2 个 API,一个在没有 Ignite 的情况下工作,但配置了 Ignite 的存储库不起作用。我不明白原因。
【问题讨论】:
-
没有例外,没有详细说明您实际上要做什么。没有提示,你试图解决你的问题。有人应该如何回答这个问题?
-
好吧,实际上你的例子对我有用。我添加了一个 POST 端点,它按预期工作。 https://github.com/symbicator/ignite-spring-boot请检查网络上没有其他Ignite节点与你的冲突。
-
您好,谢谢,我去看看
-
当我添加新实体时,它开始工作,但它全部在内存中完成,不存储在数据库中,也不从数据库中获取
标签: caching spring-boot spring-data spring-data-jpa ignite