Search code examples
spring-cloud-dataflowspring-cloud-task

Spring cloud dataflow - Composite Task with external configuration


I have a composite task with two cloud task ( AAA && BBB ). I want to pass the properties to AAA and BBB task from a directory. For example, the usage of "--spring.config.location=directory/" when launching the Spring boot application.

As per the documentation, i understand that we can pass properties using app.CompositeTaskName.taskname.prop1=val1. But, i want to load a bunch of configuration at launch. So, is there a way to launch the tasks with "spring.config.location" argument ?


Solution

  • I found the solution. I passed "--spring.config.location" in the task definition of my composite task.

    task create myctr --definition "AAA --spring.config.location=/data/prop/ '*'->BBB"
    

    I launched the composite task "myctr" and it referred the property files from the "/data/prop/" directory.

    Documentation reference : http://docs.spring.io/spring-cloud-dataflow/docs/1.7.4.RELEASE/reference/htmlsingle/#spring-cloud-dataflow-composed-tasks --> Task Application Parameters