This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Spring batch admin and multiple spring batch apps management

Sep 21st, 2011, 08:22 PM

Hi,

I am working on a project where we have to develop around 20 batch application. We decided to use spring batch framework for that. Most of this app needs to be run on schedule ie. once a day, once a week on every monday something like this. I cameacross the spring batch admin web console and saw that it can be used to manage this application. I have few question around this application and how it can be used to manage this batch applications

Does spring batch admin allow to change schedule for individual job?
How can spring batch admin pick up the new spring batch application?
-- I believe each spring batch app needs to be packaged as jar and it should have config file in proper location and just drop this new jar inside batch admin lib folder and restart the server. Please clarify this , if i misunderstood the spring batch admin docs.

Yes, you can use (for instance) a cron trigger with Spring
<task:scheduler/> features to schedule a job.

How can spring batch admin pick up the new spring batch application?

Not sure what you mean by "pick up". If jobs are packaged with the
war file you use to deploy the admin app, they are launchable from
that app, otherwise not.

The admin app picks up new executions through the JobRepository, so
you can run jobs in a different process, or a different instance of
the admin app if you prefer.

If you want to define new jobs at runtime, you can do it using the
configuration file upload feature, but you need to have all the
classes and resources available on the classpath already.

I believe each spring batch app needs to be packaged as jar and it should have config file in proper location and just drop this new jar inside batch admin lib folder and restart the server. Please clarify this , if i misunderstood the spring batch admin docs.

That pretty much sums it up.

How can I change the configuration of individual job?

Use the configuration file upload feature to change the configuration
of individual jobs at runtime. If you make major changes that require
new classes etc., or you want to persist the changes for the next
restart of the application, you need to re-package the war file and
redeploy it.