Files
spring-cloud-task/spring-cloud-task-samples/partitioned-batch-job
2022-06-15 12:39:56 +00:00
..
2022-03-11 09:57:50 -05:00
2019-03-11 12:48:37 -05:00
2019-03-11 12:48:37 -05:00
2022-06-15 12:39:56 +00:00
2022-01-26 16:13:41 -05:00

= Partitioned Job

An example of the usage of the `DeployerPartitionHandler` and
`DeployerStepExecutionHandler` to partition a Spring Batch job.

== Requirements:

* Java 17 or Above

== Build:

[source,shell,indent=2]
----
$ ./mvnw clean install
----

== Execute:

[source,shell,indent=2]
----
export SPRING_APPLICATION_JSON='{"spring.datasource.url":"jdbc:mariadb://localhost:3306/<your database>","spring.datasource.password":"<your password>","spring.datasource.username":"<your username>","spring.datasource.driverClassName":"org.mariadb.jdbc.Driver"}'
java -jar target/partitioned-batch-job-3.0.0.jar
----

NOTE: This example will use require a MySql RDBMS repository and currently uses the mariadb jdbc driver to connect.
You can changes this another driver based on your needs.

NOTE: Since this example uses the Spring Cloud Deployer Local to launch the partitions, you will need to establish the datasource settings using the SPRING_APPLICATION_JSON environment property as shown above.

== Dependencies:

A datasource (not in memory) must be configured based on normal Spring Boot conventions
(application.properties/application.yml/environment variables/etc).