Spring Boot Batch Sample Application
This spring-boot application demonstrates the following techniques:
- Using SpringBoot to create applications with embedded tomcat container
- Using GORM to create domains and query from domain
- Using Groovy Bean DSL to wire batch job dependencies (instead of annotation driven approach): @see app-context.groovy
- Schedule is done using Spring scheduler and executed via annotation configuration
- Properties provided for both H2 and MySql driver connections
- Using spring-batch-admin to expose job service and job operations and display job status in a simple UI
- A simple UI to display number job status
- Starts H2 server and allows viewing db via localhost:8082
- Uses Config.groovy for non-spring-standard properties (spring standard properties go into application.properties)
- Uses logback.groovy for logging configuration
- Uses Bootstrap class for creating test data for the domain
Functionality
Read StarCatalog data from database and extract data to csv file
Versions
@see build.gradle for all the versions used
Gotchas
spring-batch-admin:1.2.2.RELEASE does not work with spring-boot as of this day. Had to use spring-batch-admin:1.3.0.M1
Future
- Add AngularJS: Retrieve job status from spring-batch-admin as a json body, use AngularJS to display
- Start/Stop Jobs from UI
- Add SpringSecurity
- Multiple datasources
- Spring-loaded for hotswap (doesn't work currently)
Blog
Behind the scenes: http://vasya10.wordpress.com/2014/05/03/the-groovyspringbootbatchgormgroovydslbeanfactory/