Comments (5)
Hi @imperio-wxm,
Sorry for the seriously delayed response. The best way for you to do this is with KStream#branch
or in the ProcessorAPI where you can forward to specific child nodes by name. Either way, the output topics need to be defined in the topology ahead of time. Let me know if you need more info.
HTH
Bill
from kafka-streams.
@bbejeck What if we want to create a new record in addition to what we have and forward both to different child processors ? It's like,
new_record = createNewRecord(old_record);
context.forward(original_record, to(child_1));
context.forward(new_record, to(child_2));
Is this a good practice ?
from kafka-streams.
I think that's the API(Kafka) restriction and wouldn't be a good practice.
Instead of doing the above, you could have two topologies as children, and let them obtain the output of old_record
ParentTopo -> NewRecordTopo(createNewRecord) -> sink1
-> OldRecordTopo -> sink2
This could achieve your goal. @bbejeck maybe could give more insight about why Processor context cannot forward to two processors.
from kafka-streams.
Hi, @bbejeck
Sorry, my reply is late.
I think @psawmora is right.
I do like this, and it works, for a long time I didn't find any problems:
switch(type) {
case type1:
context.forward(newKey1, newValue1, TOPIC_1);
break;
case type2:
context.forward(newKey2, newValue2, TOPIC_2);
break:
.......
}
I wrote a generic Processor
to specifically split the topic. Topological image of a tree.
But source topic can only be one.
Is this a good practice ?
from kafka-streams.
But have you tried forwarding the same flow to two different processors at the same time ?
from kafka-streams.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kafka-streams.