Using spring-integration java dsl.publishSubscribeChannel () or channel ()?

I want to define a process like "do an operation A and then execute both B and C on the output payload A":

       +- [B]
[A] -> |
       +- [C]

      

I don't really need to aggregate after doing [B] and [C].

What is right?

  • End [A] with .publish ("mychannel") and define [B] and [C] integrationFlows @ Bean using IntegrationFlows.from ("mychannel") ... get ()

  • End [A] with .publishSubscribeChannel (...)

+3


source to share


1 answer


I would say the best design for you should look like XML-config:

@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")
           ...
}

      



Just because you're new here and don't feel good with many of the features here.

PS Please respect our time to let us do our job and possibly help other people. We are not going to do work for you - this is not our responsibility. Questions "how does it work?" or "It seems like a mistake to me" are good candidates for discussion. But it looks like what do you think of my design? (or for example your JIRA for complex fetching) are not that useful to the community. Unfortunately.

+2


source







All Articles