I'm using an embed spring-cloud-config server in my project (not the jdbc backend), and I'm using spring-data-jpa for other use in this project.
But the JdbcEnvironmentRepository will always be created cause it is triggerd by JdbcTemplate:
//org.springframework.cloud.config.server.config.EnvironmentRepositoryConfiguration
public class EnvironmentRepositoryConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(JdbcTemplate.class)
static class JdbcFactoryConfig {
@Bean
@ConditionalOnBean(JdbcTemplate.class)// considering use other triggers?
public JdbcEnvironmentRepositoryFactory jdbcEnvironmentRepositoryFactory(
JdbcTemplate jdbc) {
return new JdbcEnvironmentRepositoryFactory(jdbc);
}
}
}
So, how can I disable the JdbcEnvironmentRepository except excluding jpa?
Additional context
Dependency versions:
spring-cloud-config-server:2.2.2.RELEASE
spring-boot-starter-data-jpa:2.2.6.RELEASE
spring-cloud version: Hoxton.SR4
Comment From: spencergibb
Please don't cross post. You can close the stack overflow issue to track an enhancement here
Comment From: spawpaw
Ok, I've just closed the question on stackoverflow.
So is there any way to solve this problem now, or maybe in future release? @spencergibb
Comment From: ThomasVitale
@spencergibb Can I help with this issue?
Comment From: spencergibb
Sure
Comment From: ThomasVitale
@spencergibb I have created a PR for review: https://github.com/spring-cloud/spring-cloud-config/pull/1623