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.