0

I'm using the local Spring Cloud Data Flow server 1.6.0.RELEASE. When I create a new simple task definition that consists solely of the built-in timestamp task and execute it the task is properly executed and the status is marked as COMPLETE. Now I want to create my own application and use it in a task. So I created a template with the Spring Initializr with Spring Boot 2.0.4 and the cloud task dependency and customized the task as follows

@SpringBootApplication
@EnableTask
public class TaskProductSearchApplication {

    @Bean
    public CommandLineRunner commandLineRunner() {
        return new HelloWorldCommandLineRunner();
    }

    public static void main(String[] args) {
        SpringApplication.run(TaskProductSearchApplication.class, args);
    }

    public static class HelloWorldCommandLineRunner implements CommandLineRunner {

        @Override
        public void run(String... strings) throws Exception {
            System.out.println("Hello, World!");
        }
    }
}

When I create a new task within the Data Flow server with my custom application and execute it, the task prints "Hello, World!" and exits successfully, but the status of the definition is always UNKNOWN. I expect it to be COMPLETE.

I see entries for the timestamp and Hello world executions in my task_execution table but there are only entries for the timestamp execution in the task_execution_params table.

  • Task Executions don't have a status...do you mean the status of the definition? – Michael Minella Aug 01 '18 at 15:59
  • @MichaelMinella yes of course –  Aug 01 '18 at 16:09
  • Which version are you using (CloudFoundry, Kubernetes, or Local)? – Michael Minella Aug 01 '18 at 16:10
  • @MichaelMinella local –  Aug 01 '18 at 16:11
  • @user6845507 I pulled down the 1.6.0.RELEASE of SCDF and created a task 2.0 app using the code you provided and it worked for me against a mysql database. What database are you using? Also can you share a github repo with the sample project that you are working on? – Glenn Renfro Aug 01 '18 at 16:51
  • I'm using a postgres database defined in my docker-compose.yml. Here is the [gist](https://gist.github.com/lahr/886109d5c712be60ae03e9d3206e26fb). Basically the [template from the quickstart](https://raw.githubusercontent.com/spring-cloud/spring-cloud-dataflow/v1.6.0.RELEASE/spring-cloud-dataflow-server-local/docker-compose.yml) with an additional postgres service instead of H2. –  Aug 02 '18 at 07:39

0 Answers0