We are using Spring data - cassandra and when we run the application without providing configuration, spring boot tries to connect to localhost. Is there a way to stop spring boot from auto connecting?
Thanks in advance :)
We are using Spring data - cassandra and when we run the application without providing configuration, spring boot tries to connect to localhost. Is there a way to stop spring boot from auto connecting?
Thanks in advance :)
You have multiple ways to achieve that but none of them is just a boolean flag:
Provide
@Lazy
Session
/CassandraTemplate
@Bean
's yourself:Lazy beans are initialized the first time they are used.
Exclude the CassandraAutoConfiguration. Depending on your setup even more auto-configurations. This approach is rather invasive as required dependencies might get not initialized.