BatchEE provides a CLI to make it easy to integrate with companies schedulers and let JBatch batches run as any program.
BatchEE cli has several mode and can be used as a base dependency to build shades or fatjars but strength of it is revealed when used as a product:
/opt/apache/batchee/cli/bin/batchee start -lifecycle openejb -archive /opt/company/application/application.war -name mybatch
batchee script help can be accessed calling it without any argument. To get a detail help on a particular command just prefix its name byu
help, for instance to get help on
start command launch
./bin/batchee help start.
As you can see with last bullet, BatchEE CLI provides several options to start a batch. Here few interesting ones (you can get the full list/description calling
help on it):
-lifecycle: allows to start/stop a container and run the batch once it is launched. Previous sample was running it in OpenEJB (TomEE) allowing you to rely on CDI, EJB, JTA, JPA... BatchEE also provides integration for Spring or custom lifecycles/containers.
-sharedLibs: allows to add to the container/BatchEE classloader a set of jars (all the jars in the specified folder). Useful to be able to keep BatchEE, your container and your batches separated on the disk to allow partial updates (updating BatchEE without updating OpenEJB or the application for instance).
-archive: specify which application contain the batch to run, this can be a
bar. If you want to deploy a jar no need to specify this option, just ensure you added it in