I've developed couple of Spring Batch
jobs in Spring Boot
web application. For easier maintenance, I used @EnableBatchProcessing(modular = true)
like this:
@Configuration
@EnableBatchProcessing(modular = true)
public class BatchConfiguration {
@Bean
@ConditionalOnProperty(value="first.batch.enabled", havingValue = "true")
public ApplicationContextFactory firstJobs() {
return new GenericApplicationContextFactory(FirstModule.class);
}
@Bean
@ConditionalOnProperty(value="second.batch.enabled", havingValue = "true")
public ApplicationContextFactory secondJobs() {
return new GenericApplicationContextFactory(SecondModule.class);
}
...
}
and I have @Configuration
classes, one for every Job
defined respectively in base directories of modules. Everything works fine, but now I want to setup Spring Cloud Dataflow
UI to have some basic monitoring of my Jobs
.
The problem is, when I try to add @EnableTask
annotation to this class BatchConfiguration
, Spring
is not associating job execution with task execution. It is only working, when I run tests (@SpringBatchTest
).
I also tried to add @EnableTask
annotation to FirstJobConfiguration
class instead, and also add it to both BatchConfiguration
and First|JobConfiguration
, but with no effect. I also went through official documentation, but found nothing.
Is it possible to use Spring Cloud Task
with modular Spring Batch
?
Thanks.