How to integrate Apache Ignite with Cassandra as third party persistence?

Viewed 52

I tried out below configurations but I get ClassNotFoundException for org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory. I am using docker image of apache ignite to achieve the same and its version is 2.9.1.

 <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="
            http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
    <property name="cacheConfiguration">
        <list>
            <!-- Configuring persistence for "cache1" cache -->
            <bean class="org.apache.ignite.configuration.CacheConfiguration">
                <property name="name" value="cache1"/>
                <!-- Tune on Read-Through and Write-Through mode -->
                <property name="readThrough" value="true"/>
                <property name="writeThrough" value="true"/>
                <!-- Specifying CacheStoreFactory -->
                <property name="cacheStoreFactory">
                    <bean class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
                        <!-- Datasource configuration bean which is responsible for Cassandra connection details -->
                        <property name="dataSourceBean" value="cassandraDataSource"/>
                        <!-- Persistent settings bean which is responsible for the details of how objects will be persisted to Cassandra -->
                        <property name="persistenceSettingsBean" value="primitive_csndra_cache"/>
                    </bean>
                </property>
            </bean>
        </list>
          </property>
      </bean>
      
      
      <bean id="loadBalancingPolicy" class="com.datastax.driver.core.policies.TokenAwarePolicy">
              <constructor-arg type="com.datastax.driver.core.policies.LoadBalancingPolicy">
                  <bean class="com.datastax.driver.core.policies.RoundRobinPolicy"/>
              </constructor-arg>
          </bean>
      
      <bean id="cassandraAdminDataSource"
          class="org.apache.ignite.cache.store.cassandra.datasource.DataSource">
          <property name="port" value="9042" />
          <property name="contactPoints" value="mycassandra.default.svc.cluster.local" />
          <property name="readConsistency" value="ONE" />
          <property name="writeConsistency" value="ONE" />
          <property name="loadBalancingPolicy" ref="loadBalancingPolicy" />
      </bean>
      
      
      <bean id="primitive_csndra_cache" class="org.apache.ignite.cache.store.cassandra.persistence.KeyValuePersistenceSettings">
          <constructor-arg type="java.lang.String">
              <value><![CDATA[
                  <persistence keyspace="hello" table="primitive_xyz">
                      <keyPersistence class="java.lang.String" strategy="PRIMITIVE" column="key"/>
                      <valuePersistence class="java.lang.String" strategy="PRIMITIVE" column="value"/>
                  </persistence>]]>
              </value>
          </constructor-arg>
      </bean>
 </beans>

Can anyone help me out on this? Any sort of sample github project or blog reference will also work out for me.

1 Answers
Related