Is there a way to integrate spring-batch-admin and spring-boot properly?

后端 未结 5 1418
抹茶落季
抹茶落季 2021-01-04 12:34

According to the documentation spring batch admin is very easy to embed into the existing application. Simply copying web.xml and index.jsp then adding needed dependencies i

5条回答
  •  臣服心动
    2021-01-04 12:50

    The short answer is that you won't want to use @EnableBatchProcessing with Spring Batch Admin. SBA provides a number of beans on a global scale that the @EnableBatchProcessing also provides. SBA 2.0 (currently in development) will probably fill the gaps between what is currently there and what @EnableBatchProcessing provides (specifically providing the JobBuilderFactory and StepBuilderFactory).

    To get yourself running, you should be able to (I haven't tired this myself) configure in the META-INF/spring/batch/override/ directory a JobBuilderFactory and a StepBuilderFactory for global use. From there, you can use XML files in the META-INF/spring/batch/jobs directory that do nothing more than component scan for your @Configuration classes. However, leave off the @EnableBatchProcessing because of the duplication of beans.

    For the record, this isn't an Spring Boot issue since @EnableBatchProcessing is a Spring Batch annotation, not a Boot one.

提交回复
热议问题