Skip to content

venkikeesara/spring-batch-lightmin

 
 

Repository files navigation

Spring Batch Lightmin

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.

Documentation

The documentation can be found at Spring Batch Linghtmin Documentation

Samples

Samples of the Spring Batch Lightmin are available at Sample Applications

Overview

overview

Getting Started

Server

Maven Dependencies

<dependency>
    <groupId>org.tuxdevelop</groupId>
    <artifactId>spring-batch-lightmin-server</artifactId>
    <version>{spring-batch-lightmin.version}</version>
</dependency>

Enable the Server

@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.

application.properties
server.port=8090

Client

Maven Dependencies

<dependency>
    <groupId>org.tuxdevelop</groupId>
    <artifactId>spring-batch-lightmin-client</artifactId>
    <version>{spring-batch-lightmin.version}</version>
</dependency>

Enable the Client

@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.

application.properties
spring.batch.lightmin.server.url=http://localhost:8090

Embedded Server

If you want to use the SpringBatchLightmin in a single application context, an embedded server mode is provided.

Maven Dependencies

<dependency>
    <groupId>org.tuxdevelop</groupId>
    <artifactId>spring-batch-lightmin-server</artifactId>
    <version>{spring-batch-lightmin.version}</version>
</dependency>

Enable the Server

@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.

Getting the lastest SNAPSHOTS

In order to get the latest SNAPSHOTS, you have to activate the sonatype snapshot repository.

<repositories>
    <repository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>

Spring Batch Lightmin UI

Applications

The start page of the SpringBatchLightmin shows all register applications. The status value shows the current health status of the application.

index

Application Information

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.

application info

Jobs

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.

jobs

Job Instances

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.

job instances

Job Executions

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.

job instance

Job Execution

The job execution view shows you a detailed overview about the job and step executions of the selected job execution.

job execution

Job Configurations

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

Job Scheduler Configurations are cron or time based scheduler.

job scheduler configurations
Add Job Scheduler Configuration
scheduler select
Job Scheduler Type
  • CRON

  • PERIOD

scheduler add
Job Name

Registered Spring Batch Jobs.

CRON Expression

CRON expression, if the Job Scheduler Type is CRON

Fixed Delay

Restart delay, if the Job Scheduler Type is PERIOD

Initial Delay

Initial delay of the first job launch, if the Job Scheduler Type is PERIOD

Task Executor Type
  • SYNCHRONOUS

  • ASYNCHRONOUS

Scheduler Status
  • INITIALIZED

  • RUNNING

  • STOPPED

Job Parameters

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 Incrementer Type

Additional job parameter, to give each job instance uniqueness.

  • NONE

  • DATE

Job Listener

Job Listener Configurations bases on event, e.g. the viewed folder gets a new file.

job listener configurations
Add Job Listener configuration
listener select
Job Scheduler Type
  • 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.

listener add
Job Name

Registered Spring Batch Jobs.

Source Folder

The path to the listened folder

File Pattern

Ant based file pattern, e.g. *.txt

Poller Period

The time in millis between the the current and the next folder scan.

Task Executor Type
  • SYNCHRONOUS

  • ASYNCHRONOUS

Listener Status
  • ACTIVE

  • STOPPED

Job Parameters

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 Incrementer Type

Additional job parameter, to give each job instance uniqueness.

  • NONE

  • DATE

Job Launcher

job launcher select
Job Name

Name of the Spring Batch Job

Job Launcher Configuration
job launcher
Job Parameters

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

Job Incrementer

Additional job parameter, to give each job instance uniqueness.

  • NONE

  • DATE

About

Spring Batch Administration @ Spring Boot Stack

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 66.6%
  • Java 33.0%
  • CSS 0.4%