0

I have a special IntegrationFlow configured like

@Bean
public IntegrationFlow setupRabbitFlow() {
    return IntegrationFlows.from(myInputChannel)     
            .handle((p, h) -> rabbitPublisher.publishToRabbit(p, h))
            .get();
}

and some other flow that processes incoming data from some XML files, e.g. as shown here Polling from file using Java DSL - compile error when adding Files.inboundAdapter. By the end of that flow I want to pass Message to the abovementioned rabbit-sending "sink". How do I declare this?

onkami
  • 8,791
  • 17
  • 90
  • 176
  • Just a quickie: method name becomes bean name if qualifier is not defined. You probably don't want Spring component with name "setupRabbitFlow". – M. Prokhorov Jun 20 '17 at 12:43
  • I think he is fine with that logical name for the `IntegrationFlow` bean: https://github.com/spring-projects/spring-integration-java-dsl/wiki/Spring-Integration-Java-DSL-Reference – Artem Bilan Jun 20 '17 at 12:52

1 Answers1

1

One of the first class citizen in Spring Integration is a MessageChannel abstraction.

Any interaction between Spring Integration components (endpoints) is really done through the message channels.

What you need from your second flow is just specify .channel(myInputChannel) in the end of that flow. And the result of the XML processing will be send to your first flow.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118