Multiple DataSource and JdbcTemplate in Spring Boot (> 1.1.0)
It should looks like this:
@Bean(name = "jdbcSlave")@Autowiredpublic JdbcTemplate slaveJdbcTemplate(@Qualifier("dsSlave") DataSource dsSlave) { return new JdbcTemplate(dsSlave);}
Try to move @Qualifier
annotation to the parameter
on your @Bean
methods for JdbcTemplate
.
I guess, when you remove @Primary
you end up with error, where more than one appropriate beans are presented