Java – run spring batch job programmatically?

I have a spring batch application. I start with commandlinejobrunner But now I have to embed this application into our enterprise environment We have our own launcher application that I have to use For this launcher application, I need a startup class that contains a main method that will be called at startup, and I must start spring batch

Is it the only way to manually assign a joblauncher and run the work of the launcher, or is there a supported (or someone knows a sample) class in spring batch?

Solution

Yes, you can start your work programmatically If you see commandlinejobrunner in the source, the main method is to create a spring context and run the job using the launcher So you can do this in a new application

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>