Tks matthias, I did't consider about the situation you mentioned. you're
right.
one or more input topic can add to one single source node:
builder.addSource("source-1", "topic-1", "topic-2");

Or they can add to different source node:
builder.addSource("source-1", "topic-1");
builder.addSource("source-2", "topic-2");

in KStream world, one input topic to one source node:
KStream<String,String> kstream1 = builder.stream("topic-1")
KStream<String,Integer> kstream2 = builder.stream("topic-2")

many input topic to one source node:
KStream<String,String> kstream1 = builder.stream("topic-1", "topic-2")

The key and value type by Processor API is configured by
StreamsConfig.KEY_SERDE_CLASS_CONFIG and StreamsConfig.
VALUE_SERDE_CLASS_CONFIG
While the key value type by DSL is strong type.

By now, the picture is good for me...

2017-06-09 12:37 GMT+08:00 Matthias J. Sax <matth...@confluent.io>:

> Well. You can also ready multiple topics as a single KStream.
>
> > builder.stream("topic-1", "topic-2")
>
> Of course both topics must contain data with same key and value type.
> For this pattern, there is only one source node.
>
> There is no 1-to-1 relationship between input topics and source node,
> and thus, the picture is not wrong...
>
> Do you find that the picture is confusion/miss-leading?
>
>
> -Matthias
>
> On 6/8/17 5:58 PM, john cheng wrote:
> > Kafka streams topology can define one or many SourceNode.
> > The picture on official document <
> > http://kafka.apache.org/0102/documentation/streams#streams_
> architecture_tasks
> >>
> > only draw one source node in some place:
> > 1. Stream Partitions and Tasks
> > 2. Threading Model
> > 3. Local StateStore
> >
> > And the topology has two source topics: topicA and topicB
> > Should we change those picture above to two source node like the
> > Architecture part?
> >
>
>

Reply via email to