Giter VIP home page Giter VIP logo

spring-batch-lightmin's Introduction

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.

Remote Repository Server

The third repository type is the remote repository. The Job Configurations are located on an external

Maven

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

Enable the Remote Repository Server

@SpringBootApplication
@EnableSpringBatchLightminRemoteRepositoryServer
public class LightminRepositoryServer {


    public static void main(final String[] args) {
        SpringApplication.run(LightminRepositoryServer.class, args);
    }
}

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

spring-batch-lightmin's People

Contributors

tuxdevelop avatar lthielmann avatar felipempantoja avatar

Watchers

James Cloos avatar Faisal Wirakusuma avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.