The Spring Batch Lightmin is a client-server library on top of the Spring Batch and Spring Boot to monitor and configure Spring Batch Jobs. By enabling the Spring Batch Lightmin, a BatchConfigurer will be registered and provides
-
JobRepository
-
JobOperator
-
JobExplorer
-
JobLauncher
-
JobBuilderFactory
-
StepBuilderFactory
and depending beans out of the box.
The documentation can be found at Spring Batch Linghtmin Documentation
Samples of the Spring Batch Lightmin are available at Sample Applications
<dependency>
<groupId>org.tuxdevelop</groupId>
<artifactId>spring-batch-lightmin-server</artifactId>
<version>{spring-batch-lightmin.version}</version>
</dependency>
@SpringBootApplication
@EnableSpringBatchLightminServer
public class LightminServer {
public static void main(final String[] args) {
SpringApplication.run(LightminServer.class, args);
}
}
The code above enables the SpringBatchLightminServer with default properties.
<dependency>
<groupId>org.tuxdevelop</groupId>
<artifactId>spring-batch-lightmin-client</artifactId>
<version>{spring-batch-lightmin.version}</version>
</dependency>
@SpringBootApplication
@EnableSpringBatchLightminClient
public class LightminClient {
public static void main(final String[] args) {
SpringApplication.run(LightminClient.class, args);
}
}
The code above enables the SpringBatchLightminClient with the default configuration. The default configuration provides a JdbcJobRepository, JdbcConfigurationRepostor and needs a configured DataSource with the bean name dataSource.
In order to register to the SpringBatchLightminServer, the property spring.batch.lightmin.server.url has to be set.
If you want to use the SpringBatchLightmin in a single application context, an embedded server mode is provided.
<dependency>
<groupId>org.tuxdevelop</groupId>
<artifactId>spring-batch-lightmin-server</artifactId>
<version>{spring-batch-lightmin.version}</version>
</dependency>
@SpringBootApplication
@EnableEmbeddedSpringBatchLightminServer
public class LightminEmbeddedServer {
public static void main(final String[] args) {
SpringApplication.run(LightminEmbeddedServer.class, args);
}
}
The code above will boostrap the SpringBatchLightminClient and the SpringBatchLightminServer in an embedded mode.
The start page of the SpringBatchLightmin shows all register applications. The status value shows the current health status of the application.
The application information view is the entry point to the monitoring and administration of a client application. The overview shows the important endpoints, all known Spring Batch Jobs and configured external links of the client application. The Menu gives the access to monitoring (Job), administration (Job Configurations) and job launcher sections.
All known jobs of the client application will be listed in the jobs tab with their current instance count. To get more detailed informations about the job instances, you have to click on the job name, you want to view.
After selecting a job by name, all instances of the job will be listed with their current execution count. In order to get more detailed information about the executions of the instance, select the desired job instance id.
The view will show an overview of all executions for the selected instance id. To get details of the job execution, click on the desired id.
The job configurations view gives an overview about all stored job configurations. At this point, you can add and delete new job configurations, start and stop and edit existing configurations.
Job Scheduler Configurations are cron or time based scheduler.
Configurable parameters, which will be passed to the JobLauncher on each start.
The format of the parameters has to
name(type)=value, name2(type)=value2
Possible types are
-
String
-
Long
-
Double
-
Date
Job Listener Configurations bases on event, e.g. the viewed folder gets a new file.
-
LOCALE FOLDER LISTENER
If the LOCAL FOLDER LISTENER event is fired, the absolut path to the file will be passed as Job Parameter with the name fileSource to the Job Launcher.
Configurable parameters, which will be passed to the JobLauncher on each start.
The format of the parameters has to
name(type)=value, name2(type)=value2
Possible types are
-
String
-
Long
-
Double
-
Date
Configurable parameters, which will be passed to the JobLauncher on start. If an execution of the selected has already beeb launched, the JobParameters of the last run will be shown.
The format of the parameters has to
name(type)=value, name2(type)=value2
Possible types are
-
String
-
Long
-
Double
-
Date