Search code examples
spring-bootspring-cloudspring-cloud-dataflow

How to register a Spring batch in Spring Cloud Data Flow


I don't understand how to register an app. I followed a lot of guides and they use this example to explain it:

dataflow:>app register --name fileIngest --type task --uri file:///path/to/target/ingest-X.X.X.jar

My jar is in "C:\Temp" but if i set the uri: file:///Temp/myjar-0.0.1-SNAPSHOT.jar i have this error: java.lang.IllegalArgumentException: File /Temp/myjar-0.0.1-SNAPSHOT.jar must exist

Can someone explain me how to run a local batch with Spring Cloud Data Flow in local?


Solution

  • I understood how to do it. In docker-compose.yml i set the path in skipper-server and dataflow-server like this:

    image: springcloud/spring-cloud-dataflow-server:${DATAFLOW_VERSION:?DATAFLOW_VERSION is not set!} 
    container_name: dataflow-server 
    volumes: - 'C:/Temp:/root/apps'
    
    "Then the right way to register the app is: "
    app register --name 'mybatch' --type task --uri file:///root/apps/myjar-0.0.1-SNAPSHOT.jar