【问题标题】:Use-case polling HttpService and performing further actions用例轮询 HttpService 并执行进一步的操作
【发布时间】:2018-08-22 15:36:42
【问题描述】:

我的用例是这样的。我想定期轮询休息服务,并且 使用该信息调用另一个休息服务。我的 DSL 如下所示

  public IntegrationFlow flow() {
    return IntegrationFlows
        .from(() -> "messageSource", c -> c.poller(Pollers.fixedRate(5000).maxMessagesPerPoll(1)))
        .handle(Http.outboundChannelAdapter("firstRestServiceUrl"))
        .handle(Http.outboundChannelAdapter("secondRestServiceUrl")).get();
  }

我的问题是第一个处理方法会在回复通道上回复,并且消息不会进一步传递到第二个处理程序。

还是我的理解有误?应该使用一个转换器来调用 firstRestServiceUrl 而不是 handle 方法?

我从文档中的理解是句柄相当于一个服务激活器,我应该能够将输出通道设置为我的第二个服务激活器的输入!!

【问题讨论】:

    标签: spring-integration spring-integration-dsl


    【解决方案1】:

    通道适配器是单向集成,因此流在第一个适配器处停止。

    您需要一个出站网关。

    【讨论】:

      猜你喜欢
      • 2020-12-20
      • 2011-03-20
      • 1970-01-01
      • 1970-01-01
      • 2019-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多