Im trying to create a PROCESSOR that take in input one parameter and I want it to produce multiple outputs, in this case two. I have defined it like this with a costum interface
public interface MyProcessor {
String INPUT = "myInput";
@Input
SubscribableChannel myInput();
@Output("myOutput")
MessageChannel anOutput();
@Output
MessageChannel anotherOutput();
}
and than the application logic like this, just return the input parameter
@SpringBootApplication
@EnableBinding(MyProcessor.class)
public class SpringDataFlowAppApplication {
Logger logger = LoggerFactory.getLogger(SpringDataFlowAppApplication.class);
@Autowired
private MyProcessor processor;
public static void main(String[] args) {
SpringApplication.run(SpringDataFlowAppApplication.class, args);
}
@StreamListener(MyProcessor.INPUT)
public void routeValues(String val) {
processor.anOutput().send(MessageBuilder.withPayload(val).build());
processor.anotherOutput().send(MessageBuilder.withPayload(val).build());
logger.debug("SpringDataFlowAppApplication --> "+val);
}
}
Now the question is, how to connect two other processors in this outputs like in the figure. I want to parallelize some processes (PROC_! and PROC_2). For the deployment Im using SpringCloudDataFlow Console as in the image below