【问题标题】:How to send messages back from ServiceActivator to Queue in Spring integration如何在 Spring 集成中将消息从 ServiceActivator 发送回队列
【发布时间】:2019-02-22 17:40:43
【问题描述】:

您好,当队列中有消息时,我需要启动 spring 批处理作业,并且一旦处理完成,我需要将一些消息返回到 Queue 。我正在使用 Spring 集成,并且在服务激活器中,我能够从输入通道接收消息,并且一旦处理完成,我正在使用 JmsTemplate 将响应发送回队列。这是在 Spring 集成中做这件事的正确方法吗

【问题讨论】:

    标签: spring-integration message-queue spring-jms


    【解决方案1】:

    使用来自spring-batch-integrationJobLaunchingGateway...

    @Bean
    @ServiceActivator(inputChannel = "...", outputChannel = "...")
    public JobLaunchingGateway gateway() {
        return new JobLaunchingGateway(...);
    }
    

    JobExcecution 将被发送到输出通道。

    the documentation

    【讨论】:

      猜你喜欢
      • 2023-04-07
      • 1970-01-01
      • 2021-05-23
      • 2019-12-31
      • 2016-06-02
      • 2016-02-23
      • 1970-01-01
      • 1970-01-01
      • 2016-09-21
      相关资源
      最近更新 更多