I need two outputs from transformer. How to process multiple outputs from transformer with Kafka DSL? I'd like to get two KStream with different types after transform().
someMethod(KStream<String, Transaction> transaction) {
transaction
.transform(()-> new MyTransformer(...))
// what can I do here?
}
public class MyTransformer implements Transformer<...> {
public KeyValue<String, Aggregator> transform(String key, Integer value) {
if (...) {
context.forward(key1, new A(...), To.child("first_child"))
} else {
context.forward(key2, new B(...), To.child("second_child"))
}
}
}