Short:
To solve your problem, you can use transform(...) instead of process(...) , which also gives you access to the processor API in DSL.
Long
If you use process(...) , you apply the processor to the thread, however this is a “terminate” (or receiver) operation (its return type is void ), that is, it does not return any result (here, “shell” means only that the operator does not have a successor - this does not mean that any result is written somewhere!)
In addition, if you call mergedStream.process(...) and mergedStream.to(...) , you basically expand and duplicate your stream and send one copy to each downstream statement (i.e. one instance per process and one copy on to .
Mixing DSL and the processor API is absolutely possible (you've already done that;)). However, using process(...) , you cannot use forward(...) data in DSL - if you want to use the result of the processor API, you can use transform(...) instead of process(...) .
Matthias J. Sax
source share