0
votes

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?

1
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
I think he is fine with that logical name for the IntegrationFlow bean: github.com/spring-projects/spring-integration-java-dsl/wiki/… - Artem Bilan

1 Answers

1
votes

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.