In my organization's microservices, we do our own wiring for the datastax cassandra driver, so I would like to disable spring boot's auto configuration of the cassandra driver.
Because CassandraAutoConfiguration is only conditional on CqlSession existing on the classpath, the only way to do this is via @SpringBootApplication(exclude = {CassandraAutoConfiguration.class}).
However, we have a custom ApplicationContextInitializer that pre-sets some environment properties for our environment, so if there was a way to set a property to disable CassandraAutoConfiguration we would not need the boilerplate to disable in each and every microservice.
I propose a @ConditionalOnProperty for CassandraAutoConfiguration which defaults to true.
I will be opening a PR for this shortly.
In my organization's microservices, we do our own wiring for the datastax cassandra driver, so I would like to disable spring boot's auto configuration of the cassandra driver. Because
CassandraAutoConfiguration
is only conditional onCqlSession
existing on the classpath, the only way to do this is via@SpringBootApplication(exclude = {CassandraAutoConfiguration.class})
.However, we have a custom
ApplicationContextInitializer
that pre-sets some environment properties for our environment, so if there was a way to set a property to disableCassandraAutoConfiguration
we would not need the boilerplate to disable in each and every microservice.I propose a
@ConditionalOnProperty
forCassandraAutoConfiguration
which defaults to true. I will be opening a PR for this shortly.