why @Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT) not inversely
I'm not quite understand the ProcessorApp in the spring cloud stream demo, why the annotation there is @Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT) not @Transformer(inputChannel = Processor.OUTPUT, outputChannel = Processor.INPUT)
I thought the upstream of ProcessorApp is SourceApp, and the output of that was "output" channel, so the ProcessorApp should read "output" named channel not the one "input" (Processor.INPUT), is that right?
Thanks in advance.
@liaoxu could you please let us know which article are you referring to? And which class?
tutorials/spring-cloud/spring-cloud-stream-starters/twitterhdfs/src/main/java/com/baeldung/twitterhdfs/processor/ProcessorApp.java
the article is https://www.baeldung.com/spring-cloud-data-flow-stream-processing
@liaoxu,
You're correct on your assumption that data flows from a Source to the Processor and eventually to a Sink. The ProcessorApp however, works much like a delegate for the actual processing done at the Processor stage so this is reason we bind its channels in the way we see in code. If you're still not convinced, take another look at the SourceApp in the same project: it's InboundChannelAdapter uses Source.OUTPUT as the destination channel.
I hope this made things a bit clearer for you.