Spring integration 使用spring集成JavaDSL.publishSubscribeChannel()或channel()?

Spring integration 使用spring集成JavaDSL.publishSubscribeChannel()或channel()?,spring-integration,Spring Integration,我希望定义一个流程,例如“执行操作a,然后对a的输出有效负载执行B和C”: 我真的不需要在[B]和[C]执行之后进行聚合 哪个是正确的 用.publish(“mychannel”)终止[A],用integrationFlows.from(“mychannel”)…get()定义[B]和[C]integrationFlows@Bean 用.publishSubscribeChannel(…)终止[A] 我想说,您的最佳设计必须类似于XML配置: @Bean IntegrationFlow flow

我希望定义一个流程,例如“执行操作a,然后对a的输出有效负载执行B和C”:

我真的不需要在[B]和[C]执行之后进行聚合

哪个是正确的

  • 用.publish(“mychannel”)终止[A],用integrationFlows.from(“mychannel”)…get()定义[B]和[C]integrationFlows@Bean

  • 用.publishSubscribeChannel(…)终止[A]


  • 我想说,您的最佳设计必须类似于XML配置:

    @Bean
    IntegrationFlow flowA() {
       return IntegrationFlow.from(...)
                          .channel("publishSubscribeChannel")
                          .get();
    }
    
    @Bean 
    MessageChannel publishSubscribeChannel() {
       return new PublishSubscribeChannel();
    }
    
    @Bean
    IntegrationFlow flowB() {
       return IntegrationFlow.from("publishSubscribeChannel")
               ...
    }
    
    @Bean
    IntegrationFlow flowC() {
       return IntegrationFlow.from("publishSubscribeChannel")
               ...
    }
    
    只是因为你是这里的新手,对这里的很多功能还感觉不好


    另外,请尊重我们的时间,让我们做自己的工作,也许帮助别人。我们不打算为你工作,这是我们的责任。“它是如何工作的?”或“对我来说它似乎是一个bug”等问题都是很好的讨论对象。但是类似的“你对我的设计有什么看法?”(或者类似于你对复杂样本的JIRA)对社区来说并没有太大用处。对不起。

    哦,对不起,我会尽力尊重你的时间。关于我提交的jira,我只是遵循@gary russell的建议
    @Bean
    IntegrationFlow flowA() {
       return IntegrationFlow.from(...)
                          .channel("publishSubscribeChannel")
                          .get();
    }
    
    @Bean 
    MessageChannel publishSubscribeChannel() {
       return new PublishSubscribeChannel();
    }
    
    @Bean
    IntegrationFlow flowB() {
       return IntegrationFlow.from("publishSubscribeChannel")
               ...
    }
    
    @Bean
    IntegrationFlow flowC() {
       return IntegrationFlow.from("publishSubscribeChannel")
               ...
    }