Run Spring Batch Job programmatically?

前端 未结 3 1941
礼貌的吻别
礼貌的吻别 2021-02-02 15:50

I have a Spring Batch application, which I start with the CommandLineJobRunner. But now I have to embed this application into our corporate environment. There we ha

3条回答
  •  死守一世寂寞
    2021-02-02 16:06

    Yes, you can launch your job programmatically. If you see in the source of CommandLineJobRunner, the main method just create a Spring context and use the launcher to run the job. So you can do this in your new application.

提交回复
热议问题