Apache BatchEE provides a Web-UI and 2 different ways to expose Batch details via REST
For a quick out of the box solution to gather information about the JBatch environment you can use our Servlet based solution
org.apache.batchee.jaxrs.server.JBatchResourceImpl
maps more or less jakarta.batch.operations.JobOperator
API to JAXRS. It is available in batchee-jaxrs-server
module.
To define it with CXF you can use the CXFNonSpringServlet
in a servlet container, in a JavaEE container you surely already have it and just need to define a custom jakarta.ws.rs.core.Application
with JBatchResource
as class in getClasses
and configure org.apache.batchee.jaxrs.server.JBatchExceptionMapper
if you want to map jakarta.batch.operations.BatchRuntimeException
to status 500:
Note: instead of johnzon you can also use jackson as JAX-RS Json provider: com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider
. Note: JohnzonBatcheeProvider
is exactly the same as org.apache.johnzon.jaxrs.JohnzonProvider
provider with org.apache.batchee.jaxrs.common.johnzon.TimestampAdapter
registered to convert dates to timestamps. You can use Johnzon provider directly as well but the date conversion will be Johnzon one.
Here is the mapping:
Note: batchee-jaxrs-client
provides a way to query it through the JobOperator
API. You need to use org.apache.batchee.jaxrs.client.BatchEEJAXRSClientFactory.newClient(String url, Class<?> jsonProvider, API apiType)
. API.AUTO tries to use JAXRS 2 client and if not available uses cxf 2.6 clients. In this last case you need to provide cxf-rt-frontend-jaxrs
.
It is based on org.apache.batchee.servlet.JBatchController
but since the jar - batchee-servlet
- is in a webapp in a servlet 3.0 container, it is automatically added and you don't need to define it in your web.xml
.
The configuration through init parameters is:
For Spring Batch/Spring Boot applications compatible with JSR352, you can use BatchEE UI on top of Spring-Batch.
To do that you must import org.apache.batchee:spring-boot-batchee-ui
module.
If you have a custom JobOperator
implementation you can define a custom @Bean
for it otherwise a default can be provided by org.apache.batchee.spring.ui.BatchEEUI
.
You can customize the deployment with these properties:
batchee.ui.mapping
the servlet mapping to deploy the UI to (default to /batchee/*
),batchee.ui.defaultBatchNames
names of some batches you want to register even if they never ran in the UI (otherwise it is discovered after the first run).Note: this module also exists with the classifier jakarta
if you only use jakarta
namespace - but you need to flatten the dependencies, including BatchEE servlet dependency.