I used Quartz as scheduler in my application. Trying to use Spring boot 2.0 features. I have 2 different data sources in the configuration. One for application and another one f
This is a bug in spring-boot. As a workaround, I removed spring.quartz.job-store-type property and then configured DataSource and PlatformTransactionManager in customizer. Refer below updated code:
@Configuration
public class SchedulerConfig
{
private DataSource dataSource;
private PlatformTransactionManager transactionManager;
@Autowired
public SchedulerConfig(@Qualifier("schedulerDataSource") DataSource dataSource, @Qualifier("schedulerTransactionManager") PlatformTransactionManager transactionManager)
{
this.dataSource = dataSource;
this.transactionManager = transactionManager;
}
@Bean
public SchedulerFactoryBeanCustomizer schedulerFactoryBeanCustomizer()
{
return bean ->
{
bean.setDataSource(dataSource);
bean.setTransactionManager(transactionManager);
};
}
}