I am trying to use Apache Ignite with Couchbase at the backend as persistence layer. I am doing this as a data grid so that any changes made to ignite in-memory cache gets written to couchbase eventually. I am implementing this with spring-boot and spring-data. The igniteConfiguration bean looks like this
@Bean(name = "igniteConfiguration")
public IgniteConfiguration igniteConfiguration() {
IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
CacheConfiguration cache = new CacheConfiguration("sample");
cache.setAtomicityMode(CacheAtomicityMode.ATOMIC);
//The below line where I am confused
cache.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheStoreImplementationWithCouchbaseRepositoryBean.class);
cache.setCacheStoreSessionListenerFactories()
cache.setReadThrough(true);
cache.setWriteThrough(true);
igniteConfiguration.setCacheConfiguration(cache);
return igniteConfiguration;
}
I need to provide one implementation of cacheStore interface of Ignite in order to connect couchbase as backend data store. I configured Couchbase Repository class and created a bean of it in the CacheStoreImplementationWithCouchbaseRepositoryBean.java. But this repository bean is not getting initiated because CacheStoreImplementation class is not in spring context and getting null always.
As I used spring-data. Now I have
- Spring data repository for Ignite
- Spring data repository for couchbase
- One implementation of cacheStore interface of ignite
But not sure how to send the couchbase repository bean to the cacheStore implementation in a way so that it uses this repository class to execute crud operation in couchbase internally.