I want to convert an existing spring-boot application into a spring-boot + spring-batch application. This application should use a separate data source for spring-batch connecting to a separate database. Existing application uses application.properties
file and I added several batch specific
spring.batch.datasource.*
properties to application.properties
file and configured to use it in my bean definitions like these.
@Bean(name = "batchDataSource")
@ConfigurationProperties(prefix = "batch")
public DataSource batchDataSource() {
return DataSourceBuilder.create().build();
}
I guess I am not doing it in the right way and looking forward to integrate spring-batch which uses a separate data source for spring-batch meta data. Any suggestions on how best we can do this integration in existing spring-boot application?