集成流程设计建议 [英] Advice on Integration Flow Design

查看:42
本文介绍了集成流程设计建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划实施如下集成流程:

IntegrationFlows.from(httpInboundGateway).transform(transformer-rest-api-1).transform(transformer-rest-api-2).handle(jdbc-出站).handle(http-outbound-gateway-1).get();

我想要满足的要求是:

  1. 尽可能多地在并行线程中运行
  2. 在每个端点保持消息
  3. 将端点设为 rest-api(使流程具有可扩展性)

让流程具有反应性是否有意义?如果是这样怎么办?我如何在每一步登录?(窃听有帮助吗?),最后,你能否提供一个具体的例子,说明在java dsl中的上述简单实现?

解决方案

  1. 要使其并行,您需要考虑在端点之间使用 ExecutorChannel:

    IntegrationFlows.from(httpInboundGateway).channel(c -> c.executor(myTaskExecutor())).transform(transformer-rest-api-1)

等等.

  1. 但是,由于您希望有一个持久性选项,您需要考虑使用带有持久性 MessageStoreQueueChannel:https://docs.spring.io/spring-integration/docs/current/reference/html/system-management-chapter.html#message-store.然后必须为每个端点提供 poller 选项,包括用于并行处理的 tasExecutor:

    .channel(c -> c.queue(jdbcMessageStore(), "queue1Channel")).transform(transformer-rest-api-1,e ->e.poller(p -> p.fixedDelay(100).taskExecutor(myTaskExecutor())))

  2. 要将端点作为 REST API,您只需要使用 Http.outboundGateway().或者对于响应式变体 - .handle() 中的 WebFlux.outboundGateway() 而不是 transform().或者直接在流程中现有的 .handle(http-outbound-gateway-1)

  3. 要使流具有反应性,您需要使用 .channel(c -> c.flux())),但您将失去对此事的坚持.>

  4. 要记录每个步骤,需要在端点之间放置一个 .log() 运算符.

  5. 您的要求不清楚,无法分享一些示例...

I am planning to implement an integration flow as below:

IntegrationFlows.from(httpInboundGateway)
    .transform(transformer-rest-api-1)
    .transform(transformer-rest-api-2)
    .handle(jdbc-outbound)
    .handle(http-outbound-gateway-1)
    .get(); 

The requirements that I want to fulfill are:

  1. to make this run in parallel threads as much as possible
  2. persist message at every end-point
  3. make very endpoint as rest-api (to make the flow scalable)

Does it make any sense to make the flow reactive? If so how to go about it? How do I log at every step? (Does wiretap help?), and Finally, can you please provide a concrete example that of a simple implementation for above in java dsl?

解决方案

  1. To make it parallel you need to consider to use an ExecutorChannel in between endpoints:

    IntegrationFlows.from(httpInboundGateway)
       .channel(c -> c.executor(myTaskExecutor()))
       .transform(transformer-rest-api-1)
    

and so on.

  1. However since you would like to have a persistence option, you need to consider to use a QueueChannel with a persistent MessageStore: https://docs.spring.io/spring-integration/docs/current/reference/html/system-management-chapter.html#message-store. Each endpoint then has to be supplied with the poller options, including a tasExecutor for parallel processing:

    .channel(c -> c.queue(jdbcMessageStore(), "queue1Channel"))
           .transform(transformer-rest-api-1, 
                         e -> e.poller(p -> p.fixedDelay(100).taskExecutor(myTaskExecutor())))
    

  2. To make endpoints as REST API you just need to use Http.outboundGateway(). Or for reactive variant - WebFlux.outboundGateway() in the .handle() instead of transform(). Or just go ahead in the existing .handle(http-outbound-gateway-1) in your flow

  3. To make flow reactive you need to use a .channel(c -> c.flux())), but you'l lose a persistence on the matter.

  4. To log each step, there is a .log() operator to be placed in between endpoints.

  5. Your requirements are not clear to share some sample...

这篇关于集成流程设计建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆