What is the difference between Kafka Streams DSL t

2019-08-07 11:56发布

from what i read from here : https://docs.confluent.io/3.0.0/streams/developer-guide.html#streams-developer-guide-processor-api

The difference to my understanding is that i can be more specific in the Processor API as to what record serializer enters the stream (source) to what exits the stream (sink) and in the stream DSL it must be the same.

is it possible to create a Kstream with KStreamBuilder and with TopologyBuilder that will result in the exact same stream? if so can i see an example?

1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-08-07 12:17

... and in the stream DSL it must be the same.

I don't think that is right. You can take messages from an input stream, change the value or even the key, and put them on a different output stream.

final KStream<String, String> inputStream = builder.stream("inputStream");
...
inputStream
    .filter(this::acceptCertainMessages)
    .transform(new MyTransformerSupplier<String, String>("store"), "store")
    .to("outputStream");
查看更多
登录 后发表回答