Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

バッチのサンプルAPをbootRunで正常起動できるようにする #902

Closed
TakashiOhkubo opened this issue Jun 13, 2024 · 1 comment · Fixed by #1287
Closed
Assignees
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある
Milestone

Comments

@TakashiOhkubo
Copy link
Contributor

概要

おそらくSpring Batchのバージョンアップが原因と思われるが、バッチのサンプルAPがbootRunタスクで正常にジョブが動作しなくなっている。

詳細 / 機能詳細(オプション)

現状bootRunを実行すると、タスク自体は正常終了しているように見えるが、ジョブが1つも実行されずに終わっている。
BatchConfigurationクラスの@EnableBatchProcessingが非推奨となり、これを外すべきという情報があったため、これを削除すると、「複数ジョブが定義されているためどのジョブを実行すべきか不明」という旨のエラーとなる。
バージョンアップ前は、定義された全てのジョブが実行されたはずである。
実行するジョブの指定として、application.propertiesにspring.batch.job.name={実行するジョブ名}というプロパティを定義することで、bootRunで指定したジョブのみの実行はできる。
ただし単体テストについても追加で対応が必要。
バージョンアップ前と同様にbootRunで全ジョブが実行ができるようにすべきかも含め検討し、
全ジョブ実行が必要であれば、対応方法を調査する必要がある。
単体ジョブだけでよければ、上記の既知の対応と単体テストの対応を実施する。

完了条件

  • ローカルでの全ジョブ一括実行が必要であるかが検討されていること
  • bootRunタスクで、上記方針に沿って正常にジョブが実行されること
  • testタスクで、正常にテストが完了すること
@TakashiOhkubo
Copy link
Contributor Author

基本的にジョブ実行する際は、ジョブ単位で実行する上、一括での動作確認は単体テストでできるので、bootRunタスクでのジョブ一括実行は不要。

@tsuna-can-se tsuna-can-se added the target: Dressca サンプルアプリケーションDresscaに関係がある label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある
Projects
None yet
2 participants