Spring-Batchをストレスなく使う
- TLDR;
- spring-batchにはジョブ状態を管理する機能があるが、邪魔なので
application.yml
で無効にできる - その他の関連する設定についても書く
- spring-batchにはジョブ状態を管理する機能があるが、邪魔なので
application.ymlの設定
- banner-mode: off
- spring-bootの起動時のバナー表示をしない(off,console,logの設定ができる)
- initilization-schema: never
- spring-batch起動時にバッチジョブ用テーブルを初期化するかどうか
spring:
main:
banner-mode: off
batch:
initilization-schema: never
アノテーション設定
- spring-batchはジョブの状態を保存しようとするが、特にそういった機能はいらない
- ここを参考にしてデータソース自体を作らせないようにする
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})