Spring Cloud Task provides an out of the box configuration as defined in the
DefaultTaskConfigurer
and SimpleTaskConfiguration
. This section will walk through
the defaults as well as how to customize Spring Cloud Task for your needs
Spring Cloud Task utilizes a datasource for storing the results of task executions. By
default, we provide an in memory instance of H2 to provide a simple method of
bootstrapping development. However, in a production environment, you’ll want to configure
your own DataSource
.
If your application utilizes only a single DataSource
and that will serve as both your
business schema as well as the task repository, all you need to do is provide any
DataSource
(via Spring Boot’s configuration conventions is the easiest way). This will
be automatically used by Spring Cloud Task for the repository.
If your application utilizes more than one DataSource
, you’ll need to configure the
task repository with the appropriate DataSource
. This customization can be done via an
implementation of the TaskConfigurer
.