Configuring Spring-Cloud dataflow server
1 min readApr 20, 2019
Spring Cloud data flow is the new job/stream orchestrator post Spring decomissioned it’s suport for Spring Batch. It can take tasks/streams and execute them in form of microservices, which looks really cool.
The configuration is pretty straightforward and simple-
In maven pom.xml, please make following entries-
In properties-
<spring-cloud-dataflow.version>1.7.1.RELEASE</spring-cloud-dataflow.version>
In the dependencies section add the following dependencies-
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency> <dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-server-local</artifactId>
<version>${spring-cloud-dataflow.version}</version>
</dependency> <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
In the Spring Boot main application class we just need two annotations-
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.dataflow.server.EnableDataFlowServer;@SpringBootApplication
@EnableDataFlowServer/**
* Application which acts as an orchestrator for running the
* ETL tasks and streams.
* @author dhruv
*
*/public class DemoAppBatchApplication
{
public static void main(String[] args) {
SpringApplication.run(DemoAppBatchApplication.class, args);
}
}
In application.properties make the following datasource entries-
server.port=8081
spring.datasource.url= jdbc:mysql://localhost:3306/demoapp_batch
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto=none
Hit the below url
and cloud data flow should be up and running.
Fairly simple !!