I'm testing the behavior of the .channel() method and I've observed things that I don't understand.
@Bean
public IntegrationFlow flow() {
return IntegrationFlows.from("my-gateway")
.channel("first-channel")
.channel("second-channel")
.get();
}
If I place print statements in "first-channel", they aren't printed. But some of the business logic still appears to happen. Edit: Added code for service activators
@ServiceActivator(inputChannel = "first-channel")
public Message testFlow(Message message) {
System.out.println("Entered First Channel " + "\n" + "Message Header: " + message.getHeaders() + "\n" + "Message Payload" + "\n" + message.getPayload());
return message;
}
@ServiceActivator(inputChannel = "second-channel")
public Message testFlow(Message message) {
System.out.println("Entered Second Channel " + "\n" + "Message Header: " + message.getHeaders() + "\n" + "Message Payload" + "\n" + message.getPayload());
return message;
}
application.properties:
logging.level.root=TRACE
Am I allowed to pass a message through multiple channels in the same java dsl IntegrationFlow? Or are all IntegrationFlows restricted to one channel/ServiceActivator each?
Edit: Only the second print statement appears in the logs. Why is that?