Closed sathishnune closed 1 year ago
If you want to connect to different keyspaces, you have generally multiple options of which having many template instances is the last one to consider.
SessionFactory
based on AbstractRoutingSessionFactory
Statement
level. SimpleStatement
allows keyspace routing to a different keyspace. By customizing CqlTemplate
you can set the keyspace if needed and If your Cassandra version supports keyspace routingI am trying to use 3rd option to create multiple cassandraTemplates, then pass respective template to cassandraTemplateRef.
Same piece(above mentioned config) of logic is working fine with 2.7.x but failing with new Spring Boot 3.x. Would like to know what is changed & how to fix.
If you want to know the details then please provide additional context in the form of the full stack trace.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
After Spring Boot 3 upgrade, AbstractCassandraConfiguration failed to create a cassandraTemplate with different bean name.
Error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraTemplate' defined in class path resource [com/example/cassandratest/config/TestCassandraConfig.class]: No matching factory method found on class [com.example.cassandratest.config.TestCassandraConfig]: factory bean 'testCassandraConfig'; factory method 'cassandraTemplate()'. Check that a method with the specified name exists and that it is non-static.
I need multiple templates as I need to connect to multiple key spaces. Is there a way to make it work?