Below is the code for branching, it streams to only one topic (the first one). As I understand, it should stream to all three topics?
Anyway I can stream to three topics using branch?
@Bean
public Function<KStream<String, Usesr>, KStream<String, User>[]> testprocess() {
Predicate<String, User> stream1 = (k, v) -> v != null;
Predicate<String, User> stream2 = (k, v) -> v != null;
Predicate<String, User> stream3 = (k, v) -> v != null;
return input -> input.map(
(key, user) -> new KeyValue<String, User>(user.getId(), user))
.branch(stream1, stream2, stream3);
Configuration for the processor
testprocess-in-0:
destination: input.users
testprocess-out-0:
destination: users.test.out.0
testprocess-out-1:
destination: users.test.out.1
testprocess-out-2:
destination: users.test.out.2