春季云任务

有没有办法将任务结果作为输入传递给其他任务,如下图所示。听起来很简单,但我在 Internet 上找不到任何东西。我不想使用队列或其他机制来执行此操作,我正在寻找一种“本机”方式的任务。

http://img1.mukewang.com/6489736000017f5b06520292.jpg

我找到了这个例子,我认为在这种情况下,字符串代表任务的输入,但我无法弄清楚如何生成输出以发送到下一个任务


@SpringBootApplication

public class SpringCloudTaskTestApplication {


    public static void main(String[] args) {

        SpringApplication.run(SpringCloudTaskTestApplication.class, args);

    }


    @Bean

    public CommandLineRunner commandLineRunner() {

        return new HelloWorldCommandLineRunner();

    }


    public static class HelloWorldCommandLineRunner implements CommandLineRunner {


        @Override

        public void run(String... strings) throws Exception {

            System.out.println("TASK args: "+Arrays.toString(strings));

        }

    }

}


芜湖不芜
浏览 60回答 1
1回答

叮当猫咪

在 Spring Cloud Data Flow 中,您可以使用开箱即用的tasklauncher-dataflowsink流应用程序。在您的情况下,任务应用程序可以将 LaunchRequest 发送到接收tasklauncher-dataflow器应用程序以启动具有给定属性的其他任务应用程序。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java